Skip to content

Package: Gender

Gender

nameinstructionbranchcomplexitylinemethod
Gender(String, int, int, String, String)
M: 14 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
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: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getValue()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 45 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
toString()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

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