View Javadoc

1   /*
2    * joey-gen and its relative products are published under the terms
3    * of the Apache Software License.
4    * 
5    * Created on 2004/10/27 2:01:00
6    */
7   package org.asyrinx.joey.gen.model;
8   
9   
10  /***
11   * @author takeshi
12   */
13  public abstract class AbstractEnumeration extends ElementSet {
14  
15      /***
16       *  
17       */
18      public AbstractEnumeration() {
19          super((String) null);
20      }
21  
22      /***
23       *  
24       */
25      public AbstractEnumeration(Element parent, String name) {
26          this(parent, name, "int");
27      }
28  
29      /***
30       *  
31       */
32      public AbstractEnumeration(Element parent, String name, String type) {
33          super(parent, name);
34          this.valueType = type;
35      }
36  
37      /*
38       * (non-Javadoc)
39       * 
40       * @see org.asyrinx.joey.gen.model.ElementSet#isEntity()
41       */
42      public boolean isEntity() {
43          return true;
44      }
45  
46      private String valueType = "int";
47  
48      /*
49       * (non-Javadoc)
50       * 
51       * @see org.asyrinx.joey.gen.model.ElementSet#add(org.asyrinx.joey.gen.model.Element)
52       */
53      public void add(EnumerationEntry entry) {
54          super.add(entry);
55      }
56  
57      /*
58       * (non-Javadoc)
59       * 
60       * @see org.asyrinx.joey.gen.model.ElementSet#contains(org.asyrinx.joey.gen.model.Element)
61       */
62      public boolean contains(EnumerationEntry entry) {
63          return super.contains(entry);
64      }
65  
66      /*
67       * (non-Javadoc)
68       * 
69       * @see org.asyrinx.joey.gen.model.ElementSet#getElement(int)
70       */
71      public EnumerationEntry getEntry(int index) {
72          return (EnumerationEntry) super.getElement(index);
73      }
74  
75      /*
76       * (non-Javadoc)
77       * 
78       * @see org.asyrinx.joey.gen.model.ElementSet#get(java.lang.String)
79       */
80      public EnumerationEntry getEntry(String name) {
81          return (EnumerationEntry) super.getElement(name);
82      }
83  
84      /*
85       * (non-Javadoc)
86       * 
87       * @see org.asyrinx.joey.gen.model.ElementSet#remove(java.lang.String)
88       */
89      public EnumerationEntry removeEntry(String name) {
90          return (EnumerationEntry) super.removeElement(name);
91      }
92      
93      /***
94       * @return Returns the valueType.
95       */
96      public String getValueType() {
97          return valueType;
98      }
99  
100     /***
101      * @param valueType
102      *               The valueType to set.
103      */
104     public void setValueType(String type) {
105         this.valueType = type;
106     }
107 }