1 19 package gcc.generator; 20 21 public class JEntity 22 { 23 protected String _name; 24 protected int _modifiers; 25 protected JEntity _parent; 26 27 public JEntity( String name ) 28 { 29 this( name, 0 ); 30 } 31 32 public JEntity( String name, int modifiers ) 33 { 34 _name = name; 35 _modifiers = modifiers; 36 } 37 38 public JEntity getParent() 39 { 40 return _parent; 41 } 42 43 public void setParent( JEntity parent ) 44 { 45 _parent = parent; 46 } 47 48 public String getName() 49 { 50 return _name; 51 } 52 53 public void setName( String val ) 54 { 55 _name = val; 56 } 57 58 62 public void setModifier( int modifier, boolean value ) 63 { 64 if (value) 65 { 66 _modifiers = (_modifiers | modifier); 67 } 68 else 69 { 70 if ( (_modifiers & modifier) == modifier ) 71 { 72 _modifiers = ( _modifiers ^ modifier); 73 } 74 } 75 } 76 77 public void setModifiers( int modifiers ) 78 { 79 _modifiers = modifiers; 80 } 81 82 public int getModifiers() 83 { 84 return _modifiers; 85 } 86 } 87 | Popular Tags |