KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > editor > Doml > TrueFalse


1 /**
2  * <copyright>
3  * </copyright>
4  *
5  * $Id$
6  */

7 package org.enhydra.dods.editor.Doml;
8
9 import java.util.Arrays JavaDoc;
10 import java.util.Collections JavaDoc;
11 import java.util.List JavaDoc;
12
13 import org.eclipse.emf.common.util.AbstractEnumerator;
14
15 /**
16  * <!-- begin-user-doc -->
17  * A representation of the literals of the enumeration '<em><b>True False</b></em>',
18  * and utility methods for working with them.
19  * <!-- end-user-doc -->
20  * @see org.enhydra.dods.editor.Doml.DomlPackage#getTrueFalse()
21  * @model
22  * @generated
23  */

24 public final class TrueFalse extends AbstractEnumerator {
25     /**
26      * The '<em><b>True</b></em>' literal value.
27      * <!-- begin-user-doc -->
28      * <!-- end-user-doc -->
29      * @see #TRUE_LITERAL
30      * @model name="true"
31      * @generated
32      * @ordered
33      */

34     public static final int TRUE = 0;
35
36     /**
37      * The '<em><b>False</b></em>' literal value.
38      * <!-- begin-user-doc -->
39      * <!-- end-user-doc -->
40      * @see #FALSE_LITERAL
41      * @model name="false"
42      * @generated
43      * @ordered
44      */

45     public static final int FALSE = 1;
46
47     /**
48      * The '<em><b>True</b></em>' literal object.
49      * <!-- begin-user-doc -->
50      * <p>
51      * If the meaning of '<em><b>True</b></em>' literal object isn't clear,
52      * there really should be more of a description here...
53      * </p>
54      * <!-- end-user-doc -->
55      * @see #TRUE
56      * @generated
57      * @ordered
58      */

59     public static final TrueFalse TRUE_LITERAL = new TrueFalse(TRUE, "true");
60
61     /**
62      * The '<em><b>False</b></em>' literal object.
63      * <!-- begin-user-doc -->
64      * <p>
65      * If the meaning of '<em><b>False</b></em>' literal object isn't clear,
66      * there really should be more of a description here...
67      * </p>
68      * <!-- end-user-doc -->
69      * @see #FALSE
70      * @generated
71      * @ordered
72      */

73     public static final TrueFalse FALSE_LITERAL = new TrueFalse(FALSE, "false");
74
75     /**
76      * An array of all the '<em><b>True False</b></em>' enumerators.
77      * <!-- begin-user-doc -->
78      * <!-- end-user-doc -->
79      * @generated
80      */

81     private static final TrueFalse[] VALUES_ARRAY =
82         new TrueFalse[] {
83             TRUE_LITERAL,
84             FALSE_LITERAL,
85         };
86
87     /**
88      * A public read-only list of all the '<em><b>True False</b></em>' enumerators.
89      * <!-- begin-user-doc -->
90      * <!-- end-user-doc -->
91      * @generated
92      */

93     public static final List JavaDoc VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
94
95     /**
96      * Returns the '<em><b>True False</b></em>' literal with the specified name.
97      * <!-- begin-user-doc -->
98      * <!-- end-user-doc -->
99      * @generated
100      */

101     public static TrueFalse get(String JavaDoc name) {
102         for (int i = 0; i < VALUES_ARRAY.length; ++i) {
103             TrueFalse result = VALUES_ARRAY[i];
104             if (result.toString().equals(name)) {
105                 return result;
106             }
107         }
108         return null;
109     }
110
111     /**
112      * Returns the '<em><b>True False</b></em>' literal with the specified value.
113      * <!-- begin-user-doc -->
114      * <!-- end-user-doc -->
115      * @generated
116      */

117     public static TrueFalse get(int value) {
118         switch (value) {
119             case TRUE: return TRUE_LITERAL;
120             case FALSE: return FALSE_LITERAL;
121         }
122         return null;
123     }
124
125     /**
126      * Only this class can construct instances.
127      * <!-- begin-user-doc -->
128      * <!-- end-user-doc -->
129      * @generated
130      */

131     private TrueFalse(int value, String JavaDoc name) {
132         super(value, name);
133     }
134
135 } //TrueFalse
136
Popular Tags