Skip to content

Package: AlignmentType

AlignmentType

nameinstructionbranchcomplexitylinemethod
AlignmentType(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: 21 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
get(int)
M: 8 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 4 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: 45
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
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-2014 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: * EclipseSource Munich - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.template.style.alignment.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: * <!-- end-user-doc -->
27: *
28: * @see org.eclipse.emf.ecp.view.template.style.alignment.model.VTAlignmentPackage#getAlignmentType()
29: * @model
30: * @generated
31: */
32: public enum AlignmentType implements Enumerator {
33:         /**
34:          * The '<em><b>LEFT</b></em>' literal object.
35:          * <!-- begin-user-doc -->
36:          * <!-- end-user-doc -->
37:          *
38:          * @see #LEFT_VALUE
39:          * @generated
40:          * @ordered
41:          */
42:         LEFT(0, "LEFT", "LEFT"), //$NON-NLS-1$ //$NON-NLS-2$
43:
44:         /**
45:          * The '<em><b>RIGHT</b></em>' literal object.
46:          * <!-- begin-user-doc -->
47:          * <!-- end-user-doc -->
48:          *
49:          * @see #RIGHT_VALUE
50:          * @generated
51:          * @ordered
52:          */
53:         RIGHT(1, "RIGHT", "RIGHT"); //$NON-NLS-1$ //$NON-NLS-2$
54:
55:         /**
56:          * The '<em><b>LEFT</b></em>' literal value.
57:          * <!-- begin-user-doc -->
58:          * <p>
59:          * If the meaning of '<em><b>LEFT</b></em>' literal object isn't clear, there really should be more of a description
60:          * here...
61:          * </p>
62:          * <!-- end-user-doc -->
63:          *
64:          * @see #LEFT
65:          * @model
66:          * @generated
67:          * @ordered
68:          */
69:         public static final int LEFT_VALUE = 0;
70:
71:         /**
72:          * The '<em><b>RIGHT</b></em>' literal value.
73:          * <!-- begin-user-doc -->
74:          * <p>
75:          * If the meaning of '<em><b>RIGHT</b></em>' literal object isn't clear, there really should be more of a
76:          * description here...
77:          * </p>
78:          * <!-- end-user-doc -->
79:          *
80:          * @see #RIGHT
81:          * @model
82:          * @generated
83:          * @ordered
84:          */
85:         public static final int RIGHT_VALUE = 1;
86:
87:         /**
88:          * An array of all the '<em><b>Type</b></em>' enumerators.
89:          * <!-- begin-user-doc -->
90:          * <!-- end-user-doc -->
91:          *
92:          * @generated
93:          */
94:         private static final AlignmentType[] VALUES_ARRAY = new AlignmentType[] {
95:                 LEFT,
96:                 RIGHT,
97:         };
98:
99:         /**
100:          * A public read-only list of all the '<em><b>Type</b></em>' enumerators.
101:          * <!-- begin-user-doc -->
102:          * <!-- end-user-doc -->
103:          *
104:          * @generated
105:          */
106:         public static final List<AlignmentType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
107:
108:         /**
109:          * Returns the '<em><b>Type</b></em>' literal with the specified literal value.
110:          * <!-- begin-user-doc -->
111:          * <!-- end-user-doc -->
112:          *
113:          * @param literal the literal.
114:          * @return the matching enumerator or <code>null</code>.
115:          * @generated
116:          */
117:         public static AlignmentType get(String literal) {
118:•                for (int i = 0; i < VALUES_ARRAY.length; ++i) {
119:                         final AlignmentType result = VALUES_ARRAY[i];
120:•                        if (result.toString().equals(literal)) {
121:                                 return result;
122:                         }
123:                 }
124:                 return null;
125:         }
126:
127:         /**
128:          * Returns the '<em><b>Type</b></em>' literal with the specified name.
129:          * <!-- begin-user-doc -->
130:          * <!-- end-user-doc -->
131:          *
132:          * @param name the name.
133:          * @return the matching enumerator or <code>null</code>.
134:          * @generated
135:          */
136:         public static AlignmentType getByName(String name) {
137:•                for (int i = 0; i < VALUES_ARRAY.length; ++i) {
138:                         final AlignmentType result = VALUES_ARRAY[i];
139:•                        if (result.getName().equals(name)) {
140:                                 return result;
141:                         }
142:                 }
143:                 return null;
144:         }
145:
146:         /**
147:          * Returns the '<em><b>Type</b></em>' literal with the specified integer value.
148:          * <!-- begin-user-doc -->
149:          * <!-- end-user-doc -->
150:          *
151:          * @param value the integer value.
152:          * @return the matching enumerator or <code>null</code>.
153:          * @generated
154:          */
155:         public static AlignmentType get(int value) {
156:•                switch (value) {
157:                 case LEFT_VALUE:
158:                         return LEFT;
159:                 case RIGHT_VALUE:
160:                         return RIGHT;
161:                 }
162:                 return null;
163:         }
164:
165:         /**
166:          * <!-- begin-user-doc -->
167:          * <!-- end-user-doc -->
168:          *
169:          * @generated
170:          */
171:         private final int value;
172:
173:         /**
174:          * <!-- begin-user-doc -->
175:          * <!-- end-user-doc -->
176:          *
177:          * @generated
178:          */
179:         private final String name;
180:
181:         /**
182:          * <!-- begin-user-doc -->
183:          * <!-- end-user-doc -->
184:          *
185:          * @generated
186:          */
187:         private final String literal;
188:
189:         /**
190:          * Only this class can construct instances.
191:          * <!-- begin-user-doc -->
192:          * <!-- end-user-doc -->
193:          *
194:          * @generated
195:          */
196:         private AlignmentType(int value, String name, String literal) {
197:                 this.value = value;
198:                 this.name = name;
199:                 this.literal = literal;
200:         }
201:
202:         /**
203:          * <!-- begin-user-doc -->
204:          * <!-- end-user-doc -->
205:          *
206:          * @generated
207:          */
208:         @Override
209:         public int getValue() {
210:                 return value;
211:         }
212:
213:         /**
214:          * <!-- begin-user-doc -->
215:          * <!-- end-user-doc -->
216:          *
217:          * @generated
218:          */
219:         @Override
220:         public String getName() {
221:                 return name;
222:         }
223:
224:         /**
225:          * <!-- begin-user-doc -->
226:          * <!-- end-user-doc -->
227:          *
228:          * @generated
229:          */
230:         @Override
231:         public String getLiteral() {
232:                 return literal;
233:         }
234:
235:         /**
236:          * Returns the literal value of the enumerator, which is its string representation.
237:          * <!-- begin-user-doc -->
238:          * <!-- end-user-doc -->
239:          *
240:          * @generated
241:          */
242:         @Override
243:         public String toString() {
244:                 return literal;
245:         }
246:
247: } // AlignmentType