KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > ecore > change > ChangeKind


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2003-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: ChangeKind.java,v 1.3 2005/06/08 06:16:16 nickb Exp $
16  */

17 package org.eclipse.emf.ecore.change;
18
19
20 import java.util.Arrays JavaDoc;
21 import java.util.Collections JavaDoc;
22 import java.util.List JavaDoc;
23
24 import org.eclipse.emf.common.util.AbstractEnumerator;
25
26
27 /**
28  * <!-- begin-user-doc -->
29  * A representation of the literals of the enumeration '<em><b>Kind</b></em>',
30  * and utility methods for working with them.
31  * <!-- end-user-doc -->
32  * @see org.eclipse.emf.ecore.change.ChangePackage#getChangeKind()
33  * @model
34  * @generated
35  */

36 public final class ChangeKind extends AbstractEnumerator
37 {
38   /**
39    * The '<em><b>ADD</b></em>' literal value.
40    * <!-- begin-user-doc -->
41    * <!-- end-user-doc -->
42    * @see #ADD_LITERAL
43    * @model
44    * @generated
45    * @ordered
46    */

47   public static final int ADD = 0;
48
49   /**
50    * The '<em><b>REMOVE</b></em>' literal value.
51    * <!-- begin-user-doc -->
52    * <!-- end-user-doc -->
53    * @see #REMOVE_LITERAL
54    * @model
55    * @generated
56    * @ordered
57    */

58   public static final int REMOVE = 1;
59
60   /**
61    * The '<em><b>MOVE</b></em>' literal value.
62    * <!-- begin-user-doc -->
63    * <!-- end-user-doc -->
64    * @see #MOVE_LITERAL
65    * @model
66    * @generated
67    * @ordered
68    */

69   public static final int MOVE = 2;
70
71   /**
72    * The '<em><b>ADD</b></em>' literal object.
73    * <!-- begin-user-doc -->
74    * <p>
75    * If the meaning of '<em><b>ADD</b></em>' literal object isn't clear,
76    * there really should be more of a description here...
77    * </p>
78    * <!-- end-user-doc -->
79    * @see #ADD
80    * @generated
81    * @ordered
82    */

83   public static final ChangeKind ADD_LITERAL = new ChangeKind(ADD, "ADD");
84
85   /**
86    * The '<em><b>REMOVE</b></em>' literal object.
87    * <!-- begin-user-doc -->
88    * <p>
89    * If the meaning of '<em><b>REMOVE</b></em>' literal object isn't clear,
90    * there really should be more of a description here...
91    * </p>
92    * <!-- end-user-doc -->
93    * @see #REMOVE
94    * @generated
95    * @ordered
96    */

97   public static final ChangeKind REMOVE_LITERAL = new ChangeKind(REMOVE, "REMOVE");
98
99   /**
100    * The '<em><b>MOVE</b></em>' literal object.
101    * <!-- begin-user-doc -->
102    * <p>
103    * If the meaning of '<em><b>MOVE</b></em>' literal object isn't clear,
104    * there really should be more of a description here...
105    * </p>
106    * <!-- end-user-doc -->
107    * @see #MOVE
108    * @generated
109    * @ordered
110    */

111   public static final ChangeKind MOVE_LITERAL = new ChangeKind(MOVE, "MOVE");
112
113   /**
114    * An array of all the '<em><b>Kind</b></em>' enumerators.
115    * <!-- begin-user-doc -->
116    * <!-- end-user-doc -->
117    * @generated
118    */

119   private static final ChangeKind[] VALUES_ARRAY =
120     new ChangeKind[]
121     {
122       ADD_LITERAL,
123       REMOVE_LITERAL,
124       MOVE_LITERAL,
125     };
126
127   /**
128    * A public read-only list of all the '<em><b>Kind</b></em>' enumerators.
129    * <!-- begin-user-doc -->
130    * <!-- end-user-doc -->
131    * @generated
132    */

133   public static final List JavaDoc VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
134
135   /**
136    * Returns the '<em><b>Kind</b></em>' literal with the specified name.
137    * <!-- begin-user-doc -->
138    * <!-- end-user-doc -->
139    * @generated
140    */

141   public static ChangeKind get(String JavaDoc name)
142   {
143     for (int i = 0; i < VALUES_ARRAY.length; ++i)
144     {
145       ChangeKind result = VALUES_ARRAY[i];
146       if (result.toString().equals(name))
147       {
148         return result;
149       }
150     }
151     return null;
152   }
153
154   /**
155    * Returns the '<em><b>Kind</b></em>' literal with the specified value.
156    * <!-- begin-user-doc -->
157    * <!-- end-user-doc -->
158    * @generated
159    */

160   public static ChangeKind get(int value)
161   {
162     switch (value)
163     {
164       case ADD: return ADD_LITERAL;
165       case REMOVE: return REMOVE_LITERAL;
166       case MOVE: return MOVE_LITERAL;
167     }
168     return null;
169   }
170
171   /**
172    * Only this class can construct instances.
173    * <!-- begin-user-doc -->
174    * <!-- end-user-doc -->
175    * @generated
176    */

177   private ChangeKind(int value, String JavaDoc name)
178   {
179     super(value, name);
180   }
181
182 } //ChangeKind
183
Popular Tags