/** * * * * $Id: GENDER.java,v 1.3 2011/01/05 15:06:12 glefur Exp $ */ package org.eclipse.emf.samples.conference; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.eclipse.emf.common.util.Enumerator; /** * * A representation of the literals of the enumeration 'GENDER', * and utility methods for working with them. * * @see org.eclipse.emf.samples.conference.ConferencePackage#getGENDER() * @model * @generated */ public enum GENDER implements Enumerator { /** * The 'MALE' literal object. * * * @see #MALE_VALUE * @generated * @ordered */ MALE(0, "MALE", "male"), /** * The 'FEMALE' literal object. * * * @see #FEMALE_VALUE * @generated * @ordered */ FEMALE(1, "FEMALE", "female"), /** * The 'UNKNOWN' literal object. * * * @see #UNKNOWN_VALUE * @generated * @ordered */ UNKNOWN(3, "UNKNOWN", "unknown"); /** * The 'MALE' literal value. * *

* If the meaning of 'MALE' literal object isn't clear, * there really should be more of a description here... *

* * @see #MALE * @model literal="male" * @generated * @ordered */ public static final int MALE_VALUE = 0; /** * The 'FEMALE' literal value. * *

* If the meaning of 'FEMALE' literal object isn't clear, * there really should be more of a description here... *

* * @see #FEMALE * @model literal="female" * @generated * @ordered */ public static final int FEMALE_VALUE = 1; /** * The 'UNKNOWN' literal value. * *

* If the meaning of 'UNKNOWN' literal object isn't clear, * there really should be more of a description here... *

* * @see #UNKNOWN * @model literal="unknown" * @generated * @ordered */ public static final int UNKNOWN_VALUE = 3; /** * An array of all the 'GENDER' enumerators. * * * @generated */ private static final GENDER[] VALUES_ARRAY = new GENDER[] { MALE, FEMALE, UNKNOWN, }; /** * A public read-only list of all the 'GENDER' enumerators. * * * @generated */ public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the 'GENDER' literal with the specified literal value. * * * @generated */ public static GENDER get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { GENDER result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the 'GENDER' literal with the specified name. * * * @generated */ public static GENDER getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { GENDER result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the 'GENDER' literal with the specified integer value. * * * @generated */ public static GENDER get(int value) { switch (value) { case MALE_VALUE: return MALE; case FEMALE_VALUE: return FEMALE; case UNKNOWN_VALUE: return UNKNOWN; } return null; } /** * * * @generated */ private final int value; /** * * * @generated */ private final String name; /** * * * @generated */ private final String literal; /** * Only this class can construct instances. * * * @generated */ private GENDER(int value, String name, String literal) { this.value = value; this.name = name; this.literal = literal; } /** * * * @generated */ public int getValue() { return value; } /** * * * @generated */ public String getName() { return name; } /** * * * @generated */ public String getLiteral() { return literal; } /** * Returns the literal value of the enumerator, which is its string representation. * * * @generated */ @Override public String toString() { return literal; } } //GENDER