/Users/lyon/j4p/src/net/rmi/rmiSynth/lex/LexStructure.java

1    /** 
2     * Class LexStructure - root class for rmi.rmiSynth.lex.Lex classes 
3     * Each structure(class, method, field) has name, modifier, and type(except class) 
4     * @author Roman Yedokov 
5     */ 
6     
7    package net.rmi.rmiSynth.lex; 
8     
9     
10   abstract public class LexStructure { 
11       private String name;        //Name 
12       private LexModif modif;     //Modifier 
13       private LexType type;       //Type 
14    
15       /** 
16        * Constructor 
17        */ 
18       public LexStructure() { 
19           name = ""; 
20           modif = new LexModif(); 
21           type = new LexType(); 
22       } 
23    
24       /** 
25        * Gets name of structure 
26        */ 
27       public String getName() { 
28           return name; 
29       } 
30    
31       /** 
32        * Sets name of structure 
33        * 
34        * @param _name New name 
35        */ 
36       public void setName(String _name) { 
37           name = _name; 
38       } 
39    
40       /** 
41        * Gets modifier of structure 
42        */ 
43       public LexModif getModif() { 
44           return modif; 
45       } 
46    
47       /** 
48        * Sets modifier of structure 
49        * 
50        * @param _modif New modifier 
51        */ 
52       public void setModif(LexModif _modif) { 
53           modif = _modif; 
54       } 
55    
56       /** 
57        * Gets type of structure 
58        */ 
59       public LexType getType() { 
60           return type; 
61       } 
62    
63       /** 
64        * Sets type of structure 
65        * 
66        * @param _type New type 
67        */ 
68       public void setType(LexType _type) { 
69           type = _type; 
70       } 
71    
72       /** 
73        * Header to string 
74        * 
75        * @return s modifier + type + name 
76        */ 
77       public String getHeader() { 
78           String s = ""; 
79           s = s + getModif().toString(); 
80           s = s + getType().toString(); 
81           s = s + getName(); 
82           return s; 
83       } 
84   } 
85