Skip to content

Package: GroupType

GroupType

nameinstructionbranchcomplexitylinemethod
GroupType(String, int, int, String, String)
M: 0 C: 14
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
get(String)
M: 2 C: 19
90%
M: 1 C: 3
75%
M: 1 C: 2
67%
M: 1 C: 4
80%
M: 0 C: 1
100%
get(int)
M: 10 C: 0
0%
M: 4 C: 0
0%
M: 4 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getByName(String)
M: 21 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getLiteral()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getName()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getValue()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
static {...}
M: 0 C: 62
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 9
100%
M: 0 C: 1
100%
toString()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.spi.group.model;
15:
16: import java.util.Arrays;
17: import java.util.Collections;
18: import java.util.List;
19:
20: import org.eclipse.emf.common.util.Enumerator;
21:
22: /**
23: * <!-- begin-user-doc -->
24: * A representation of the literals of the enumeration '<em><b>Type</b></em>',
25: * and utility methods for working with them.
26: *
27: * @since 1.4
28: * <!-- end-user-doc -->
29: * @see org.eclipse.emf.ecp.view.spi.group.model.VGroupPackage#getGroupType()
30: * @model
31: * @generated
32: */
33: public enum GroupType implements Enumerator {
34:         /**
35:          * The '<em><b>Normal</b></em>' literal object.
36:          * <!-- begin-user-doc -->
37:          * <!-- end-user-doc -->
38:          *
39:          * @see #NORMAL_VALUE
40:          * @generated
41:          * @ordered
42:          */
43:         NORMAL(0, "Normal", "Normal"), //$NON-NLS-1$ //$NON-NLS-2$
44:
45:         /**
46:          * The '<em><b>Embedded</b></em>' literal object.
47:          * <!-- begin-user-doc -->
48:          * <!-- end-user-doc -->
49:          *
50:          * @see #EMBEDDED_VALUE
51:          * @generated
52:          * @ordered
53:          */
54:         EMBEDDED(1, "Embedded", "Embedded"), //$NON-NLS-1$ //$NON-NLS-2$
55:
56:         /**
57:          * The '<em><b>Collapsible</b></em>' literal object.
58:          * <!-- begin-user-doc -->
59:          * <!-- end-user-doc -->
60:          *
61:          * @see #COLLAPSIBLE_VALUE
62:          * @generated
63:          * @ordered
64:          */
65:         COLLAPSIBLE(2, "Collapsible", "Collapsible"); //$NON-NLS-1$ //$NON-NLS-2$
66:
67:         /**
68:          * The '<em><b>Normal</b></em>' literal value.
69:          * <!-- begin-user-doc -->
70:          * <p>
71:          * If the meaning of '<em><b>Normal</b></em>' literal object isn't clear, there really should be more of a
72:          * description here...
73:          * </p>
74:          * <!-- end-user-doc -->
75:          *
76:          * @see #NORMAL
77:          * @model name="Normal"
78:          * @generated
79:          * @ordered
80:          */
81:         public static final int NORMAL_VALUE = 0;
82:
83:         /**
84:          * The '<em><b>Embedded</b></em>' literal value.
85:          * <!-- begin-user-doc -->
86:          * <p>
87:          * If the meaning of '<em><b>Embedded</b></em>' literal object isn't clear, there really should be more of a
88:          * description here...
89:          * </p>
90:          * <!-- end-user-doc -->
91:          *
92:          * @see #EMBEDDED
93:          * @model name="Embedded"
94:          * @generated
95:          * @ordered
96:          */
97:         public static final int EMBEDDED_VALUE = 1;
98:
99:         /**
100:          * The '<em><b>Collapsible</b></em>' literal value.
101:          * <!-- begin-user-doc -->
102:          * <p>
103:          * If the meaning of '<em><b>Collapsible</b></em>' literal object isn't clear, there really should be more of a
104:          * description here...
105:          * </p>
106:          * <!-- end-user-doc -->
107:          *
108:          * @see #COLLAPSIBLE
109:          * @model name="Collapsible"
110:          * @generated
111:          * @ordered
112:          */
113:         public static final int COLLAPSIBLE_VALUE = 2;
114:
115:         /**
116:          * An array of all the '<em><b>Type</b></em>' enumerators.
117:          * <!-- begin-user-doc -->
118:          * <!-- end-user-doc -->
119:          *
120:          * @generated
121:          */
122:         private static final GroupType[] VALUES_ARRAY = new GroupType[] {
123:                 NORMAL,
124:                 EMBEDDED,
125:                 COLLAPSIBLE,
126:         };
127:
128:         /**
129:          * A public read-only list of all the '<em><b>Type</b></em>' enumerators.
130:          * <!-- begin-user-doc -->
131:          * <!-- end-user-doc -->
132:          *
133:          * @generated
134:          */
135:         public static final List<GroupType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
136:
137:         /**
138:          * Returns the '<em><b>Type</b></em>' literal with the specified literal value.
139:          * <!-- begin-user-doc -->
140:          * <!-- end-user-doc -->
141:          *
142:          * @param literal the literal.
143:          * @return the matching enumerator or <code>null</code>.
144:          * @generated
145:          */
146:         public static GroupType get(String literal) {
147:•                for (int i = 0; i < VALUES_ARRAY.length; ++i) {
148:                         GroupType result = VALUES_ARRAY[i];
149:•                        if (result.toString().equals(literal)) {
150:                                 return result;
151:                         }
152:                 }
153:                 return null;
154:         }
155:
156:         /**
157:          * Returns the '<em><b>Type</b></em>' literal with the specified name.
158:          * <!-- begin-user-doc -->
159:          * <!-- end-user-doc -->
160:          *
161:          * @param name the name.
162:          * @return the matching enumerator or <code>null</code>.
163:          * @generated
164:          */
165:         public static GroupType getByName(String name) {
166:•                for (int i = 0; i < VALUES_ARRAY.length; ++i) {
167:                         GroupType result = VALUES_ARRAY[i];
168:•                        if (result.getName().equals(name)) {
169:                                 return result;
170:                         }
171:                 }
172:                 return null;
173:         }
174:
175:         /**
176:          * Returns the '<em><b>Type</b></em>' literal with the specified integer value.
177:          * <!-- begin-user-doc -->
178:          * <!-- end-user-doc -->
179:          *
180:          * @param value the integer value.
181:          * @return the matching enumerator or <code>null</code>.
182:          * @generated
183:          */
184:         public static GroupType get(int value) {
185:•                switch (value) {
186:                 case NORMAL_VALUE:
187:                         return NORMAL;
188:                 case EMBEDDED_VALUE:
189:                         return EMBEDDED;
190:                 case COLLAPSIBLE_VALUE:
191:                         return COLLAPSIBLE;
192:                 }
193:                 return null;
194:         }
195:
196:         /**
197:          * <!-- begin-user-doc -->
198:          * <!-- end-user-doc -->
199:          *
200:          * @generated
201:          */
202:         private final int value;
203:
204:         /**
205:          * <!-- begin-user-doc -->
206:          * <!-- end-user-doc -->
207:          *
208:          * @generated
209:          */
210:         private final String name;
211:
212:         /**
213:          * <!-- begin-user-doc -->
214:          * <!-- end-user-doc -->
215:          *
216:          * @generated
217:          */
218:         private final String literal;
219:
220:         /**
221:          * Only this class can construct instances.
222:          * <!-- begin-user-doc -->
223:          * <!-- end-user-doc -->
224:          *
225:          * @generated
226:          */
227:         private GroupType(int value, String name, String literal) {
228:                 this.value = value;
229:                 this.name = name;
230:                 this.literal = literal;
231:         }
232:
233:         /**
234:          * <!-- begin-user-doc -->
235:          * <!-- end-user-doc -->
236:          *
237:          * @generated
238:          */
239:         @Override
240:         public int getValue() {
241:                 return value;
242:         }
243:
244:         /**
245:          * <!-- begin-user-doc -->
246:          * <!-- end-user-doc -->
247:          *
248:          * @generated
249:          */
250:         @Override
251:         public String getName() {
252:                 return name;
253:         }
254:
255:         /**
256:          * <!-- begin-user-doc -->
257:          * <!-- end-user-doc -->
258:          *
259:          * @generated
260:          */
261:         @Override
262:         public String getLiteral() {
263:                 return literal;
264:         }
265:
266:         /**
267:          * Returns the literal value of the enumerator, which is its string representation.
268:          * <!-- begin-user-doc -->
269:          * <!-- end-user-doc -->
270:          *
271:          * @generated
272:          */
273:         @Override
274:         public String toString() {
275:                 return literal;
276:         }
277:
278: } // GroupType