View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 1.1.2.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package org.sourceforge.mbeanmonitoring.report.castor.types;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import java.util.Hashtable;
15  
16  /**
17   * Class MethodStatNameType.
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class MethodStatNameType implements java.io.Serializable {
22  
23  
24        //--------------------------/
25       //- Class/Member Variables -/
26      //--------------------------/
27  
28      /**
29       * The Count type
30       */
31      public static final int COUNT_TYPE = 0;
32  
33      /**
34       * The instance of the Count type
35       */
36      public static final MethodStatNameType COUNT = new MethodStatNameType(COUNT_TYPE, "Count");
37  
38      /**
39       * The Min.Time type
40       */
41      public static final int MIN_TIME_TYPE = 1;
42  
43      /**
44       * The instance of the Min.Time type
45       */
46      public static final MethodStatNameType MIN_TIME = new MethodStatNameType(MIN_TIME_TYPE, "Min.Time");
47  
48      /**
49       * The Moy.Time type
50       */
51      public static final int MOY_TIME_TYPE = 2;
52  
53      /**
54       * The instance of the Moy.Time type
55       */
56      public static final MethodStatNameType MOY_TIME = new MethodStatNameType(MOY_TIME_TYPE, "Moy.Time");
57  
58      /**
59       * The Max.Time type
60       */
61      public static final int MAX_TIME_TYPE = 3;
62  
63      /**
64       * The instance of the Max.Time type
65       */
66      public static final MethodStatNameType MAX_TIME = new MethodStatNameType(MAX_TIME_TYPE, "Max.Time");
67  
68      /**
69       * The Total.Time type
70       */
71      public static final int TOTAL_TIME_TYPE = 4;
72  
73      /**
74       * The instance of the Total.Time type
75       */
76      public static final MethodStatNameType TOTAL_TIME = new MethodStatNameType(TOTAL_TIME_TYPE, "Total.Time");
77  
78      /**
79       * The low type
80       */
81      public static final int LOW_TYPE = 5;
82  
83      /**
84       * The instance of the low type
85       */
86      public static final MethodStatNameType LOW = new MethodStatNameType(LOW_TYPE, "low");
87  
88      /**
89       * The high type
90       */
91      public static final int HIGH_TYPE = 6;
92  
93      /**
94       * The instance of the high type
95       */
96      public static final MethodStatNameType HIGH = new MethodStatNameType(HIGH_TYPE, "high");
97  
98      /**
99       * The current type
100      */
101     public static final int CURRENT_TYPE = 7;
102 
103     /**
104      * The instance of the current type
105      */
106     public static final MethodStatNameType CURRENT = new MethodStatNameType(CURRENT_TYPE, "current");
107 
108     /**
109      * Field _memberTable.
110      */
111     private static java.util.Hashtable _memberTable = init();
112 
113     /**
114      * Field type.
115      */
116     private final int type;
117 
118     /**
119      * Field stringValue.
120      */
121     private java.lang.String stringValue = null;
122 
123 
124       //----------------/
125      //- Constructors -/
126     //----------------/
127 
128     private MethodStatNameType(final int type, final java.lang.String value) {
129         super();
130         this.type = type;
131         this.stringValue = value;
132     }
133 
134 
135       //-----------/
136      //- Methods -/
137     //-----------/
138 
139     /**
140      * Method enumerate.Returns an enumeration of all possible
141      * instances of MethodStatNameType
142      * 
143      * @return an Enumeration over all possible instances of
144      * MethodStatNameType
145      */
146     public static java.util.Enumeration enumerate(
147     ) {
148         return _memberTable.elements();
149     }
150 
151     /**
152      * Method getType.Returns the type of this MethodStatNameType
153      * 
154      * @return the type of this MethodStatNameType
155      */
156     public int getType(
157     ) {
158         return this.type;
159     }
160 
161     /**
162      * Method init.
163      * 
164      * @return the initialized Hashtable for the member table
165      */
166     private static java.util.Hashtable init(
167     ) {
168         Hashtable members = new Hashtable();
169         members.put("Count", COUNT);
170         members.put("Min.Time", MIN_TIME);
171         members.put("Moy.Time", MOY_TIME);
172         members.put("Max.Time", MAX_TIME);
173         members.put("Total.Time", TOTAL_TIME);
174         members.put("low", LOW);
175         members.put("high", HIGH);
176         members.put("current", CURRENT);
177         return members;
178     }
179 
180     /**
181      * Method readResolve. will be called during deserialization to
182      * replace the deserialized object with the correct constant
183      * instance.
184      * 
185      * @return this deserialized object
186      */
187     private java.lang.Object readResolve(
188     ) {
189         return valueOf(this.stringValue);
190     }
191 
192     /**
193      * Method toString.Returns the String representation of this
194      * MethodStatNameType
195      * 
196      * @return the String representation of this MethodStatNameType
197      */
198     public java.lang.String toString(
199     ) {
200         return this.stringValue;
201     }
202 
203     /**
204      * Method valueOf.Returns a new MethodStatNameType based on the
205      * given String value.
206      * 
207      * @param string
208      * @return the MethodStatNameType value of parameter 'string'
209      */
210     public static org.sourceforge.mbeanmonitoring.report.castor.types.MethodStatNameType valueOf(
211             final java.lang.String string) {
212         java.lang.Object obj = null;
213         if (string != null) {
214             obj = _memberTable.get(string);
215         }
216         if (obj == null) {
217             String err = "" + string + " is not a valid MethodStatNameType";
218             throw new IllegalArgumentException(err);
219         }
220         return (MethodStatNameType) obj;
221     }
222 
223 }