Skip to content

Package: LabelAlignment

LabelAlignment

nameinstructionbranchcomplexitylinemethod
LabelAlignment(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: 12 C: 0
0%
M: 5 C: 0
0%
M: 5 C: 0
0%
M: 6 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: 79
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 11
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.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>Label Alignment</b></em>',
25: * and utility methods for working with them.
26: *
27: * @since 1.2
28: * <!-- end-user-doc -->
29: * @see org.eclipse.emf.ecp.view.spi.model.VViewPackage#getLabelAlignment()
30: * @model
31: * @generated
32: */
33: public enum LabelAlignment implements Enumerator {
34:         /**
35:          * The '<em><b>Default</b></em>' literal object.
36:          * <!-- begin-user-doc -->
37:          *
38:          * @since 1.7
39:          * <!-- end-user-doc -->
40:          * @see #DEFAULT_VALUE
41:          * @generated
42:          * @ordered
43:          */
44:         DEFAULT(-1, "Default", "Default"), //$NON-NLS-1$ //$NON-NLS-2$
45:
46:         /**
47:          * The '<em><b>Left</b></em>' literal object.
48:          * <!-- begin-user-doc -->
49:          * <!-- end-user-doc -->
50:          *
51:          * @see #LEFT_VALUE
52:          * @generated
53:          * @ordered
54:          */
55:         LEFT(0, "Left", "Left"), //$NON-NLS-1$//$NON-NLS-2$
56:
57:         /**
58:          * The '<em><b>Top</b></em>' literal object.
59:          * <!-- begin-user-doc -->
60:          *
61:          * @since 1.7
62:          * <!-- end-user-doc -->
63:          * @see #TOP_VALUE
64:          * @generated
65:          * @ordered
66:          */
67:         TOP(2, "Top", "Top"), //$NON-NLS-1$ //$NON-NLS-2$
68:
69:         /**
70:          * The '<em><b>None</b></em>' literal object.
71:          * <!-- begin-user-doc -->
72:          * <!-- end-user-doc -->
73:          *
74:          * @see #NONE_VALUE
75:          * @generated
76:          * @ordered
77:          */
78:         NONE(1, "None", "None"); //$NON-NLS-1$ //$NON-NLS-2$
79:
80:         /**
81:          * The '<em><b>Default</b></em>' literal value.
82:          * <!-- begin-user-doc -->
83:          * <p>
84:          * If the meaning of '<em><b>Default</b></em>' literal object isn't clear,
85:          * there really should be more of a description here...
86:          * </p>
87:          *
88:          * @since 1.7
89:          * <!-- end-user-doc -->
90:          * @see #DEFAULT
91:          * @model name="Default"
92:          * @generated
93:          * @ordered
94:          */
95:         public static final int DEFAULT_VALUE = -1;
96:
97:         /**
98:          * The '<em><b>Left</b></em>' literal value.
99:          * <!-- begin-user-doc -->
100:          * <p>
101:          * If the meaning of '<em><b>Left</b></em>' literal object isn't clear, there really should be more of a description
102:          * here...
103:          * </p>
104:          * <!-- end-user-doc -->
105:          *
106:          * @see #LEFT
107:          * @model name="Left"
108:          * @generated
109:          * @ordered
110:          */
111:         public static final int LEFT_VALUE = 0;
112:
113:         /**
114:          * The '<em><b>Top</b></em>' literal value.
115:          * <!-- begin-user-doc -->
116:          * <p>
117:          * If the meaning of '<em><b>Top</b></em>' literal object isn't clear,
118:          * there really should be more of a description here...
119:          * </p>
120:          *
121:          * @since 1.7
122:          * <!-- end-user-doc -->
123:          * @see #TOP
124:          * @model name="Top"
125:          * @generated
126:          * @ordered
127:          */
128:         public static final int TOP_VALUE = 2;
129:
130:         /**
131:          * The '<em><b>None</b></em>' literal value.
132:          * <!-- begin-user-doc -->
133:          * <p>
134:          * If the meaning of '<em><b>None</b></em>' literal object isn't clear, there really should be more of a description
135:          * here...
136:          * </p>
137:          * <!-- end-user-doc -->
138:          *
139:          * @see #NONE
140:          * @model name="None"
141:          * @generated
142:          * @ordered
143:          */
144:         public static final int NONE_VALUE = 1;
145:
146:         /**
147:          * An array of all the '<em><b>Label Alignment</b></em>' enumerators.
148:          * <!-- begin-user-doc -->
149:          * <!-- end-user-doc -->
150:          *
151:          * @generated
152:          */
153:         private static final LabelAlignment[] VALUES_ARRAY = new LabelAlignment[] {
154:                 DEFAULT,
155:                 LEFT,
156:                 TOP,
157:                 NONE,
158:         };
159:
160:         /**
161:          * A public read-only list of all the '<em><b>Label Alignment</b></em>' enumerators.
162:          * <!-- begin-user-doc -->
163:          * <!-- end-user-doc -->
164:          *
165:          * @generated
166:          */
167:         public static final List<LabelAlignment> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
168:
169:         /**
170:          * Returns the '<em><b>Label Alignment</b></em>' literal with the specified literal value.
171:          * <!-- begin-user-doc -->
172:          * <!-- end-user-doc -->
173:          *
174:          * @param literal the literal.
175:          * @return the matching enumerator or <code>null</code>.
176:          * @generated
177:          */
178:         public static LabelAlignment get(String literal) {
179:•                for (int i = 0; i < VALUES_ARRAY.length; ++i) {
180:                         final LabelAlignment result = VALUES_ARRAY[i];
181:•                        if (result.toString().equals(literal)) {
182:                                 return result;
183:                         }
184:                 }
185:                 return null;
186:         }
187:
188:         /**
189:          * Returns the '<em><b>Label Alignment</b></em>' literal with the specified name.
190:          * <!-- begin-user-doc -->
191:          * <!-- end-user-doc -->
192:          *
193:          * @param name the name.
194:          * @return the matching enumerator or <code>null</code>.
195:          * @generated
196:          */
197:         public static LabelAlignment getByName(String name) {
198:•                for (int i = 0; i < VALUES_ARRAY.length; ++i) {
199:                         final LabelAlignment result = VALUES_ARRAY[i];
200:•                        if (result.getName().equals(name)) {
201:                                 return result;
202:                         }
203:                 }
204:                 return null;
205:         }
206:
207:         /**
208:          * Returns the '<em><b>Label Alignment</b></em>' literal with the specified integer value.
209:          * <!-- begin-user-doc -->
210:          * <!-- end-user-doc -->
211:          *
212:          * @param value the integer value.
213:          * @return the matching enumerator or <code>null</code>.
214:          * @generated
215:          */
216:         public static LabelAlignment get(int value) {
217:•                switch (value) {
218:                 case DEFAULT_VALUE:
219:                         return DEFAULT;
220:                 case LEFT_VALUE:
221:                         return LEFT;
222:                 case TOP_VALUE:
223:                         return TOP;
224:                 case NONE_VALUE:
225:                         return NONE;
226:                 }
227:                 return null;
228:         }
229:
230:         /**
231:          * <!-- begin-user-doc -->
232:          * <!-- end-user-doc -->
233:          *
234:          * @generated
235:          */
236:         private final int value;
237:
238:         /**
239:          * <!-- begin-user-doc -->
240:          * <!-- end-user-doc -->
241:          *
242:          * @generated
243:          */
244:         private final String name;
245:
246:         /**
247:          * <!-- begin-user-doc -->
248:          * <!-- end-user-doc -->
249:          *
250:          * @generated
251:          */
252:         private final String literal;
253:
254:         /**
255:          * Only this class can construct instances.
256:          * <!-- begin-user-doc -->
257:          * <!-- end-user-doc -->
258:          *
259:          * @generated
260:          */
261:         private LabelAlignment(int value, String name, String literal) {
262:                 this.value = value;
263:                 this.name = name;
264:                 this.literal = literal;
265:         }
266:
267:         /**
268:          * <!-- begin-user-doc -->
269:          * <!-- end-user-doc -->
270:          *
271:          * @generated
272:          */
273:         @Override
274:         public int getValue() {
275:                 return value;
276:         }
277:
278:         /**
279:          * <!-- begin-user-doc -->
280:          * <!-- end-user-doc -->
281:          *
282:          * @generated
283:          */
284:         @Override
285:         public String getName() {
286:                 return name;
287:         }
288:
289:         /**
290:          * <!-- begin-user-doc -->
291:          * <!-- end-user-doc -->
292:          *
293:          * @generated
294:          */
295:         @Override
296:         public String getLiteral() {
297:                 return literal;
298:         }
299:
300:         /**
301:          * Returns the literal value of the enumerator, which is its string representation.
302:          * <!-- begin-user-doc -->
303:          * <!-- end-user-doc -->
304:          *
305:          * @generated
306:          */
307:         @Override
308:         public String toString() {
309:                 return literal;
310:         }
311:
312: } // LabelAlignment