/***************************************************************************** * Copyright (c) 2010 CEA LIST. * * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Chokri MRAIDHA (CEA LIST) chokri.mraidha@cea.fr - Initial API and implementation * *****************************************************************************/ package org.eclipse.papyrus.MARTE_Library.MeasurementUnits; 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 'Length Unit Kind', * and utility methods for working with them. * * @see org.eclipse.papyrus.MARTE_Library.MeasurementUnits.MeasurementUnitsPackage#getLengthUnitKind() * @model * @generated */ public enum LengthUnitKind implements Enumerator { /** * The 'M' literal object. * * * @see #M_VALUE * @generated * @ordered */ M(0, "m", "m"), /** * The 'Cm' literal object. * * * @see #CM_VALUE * @generated * @ordered */ CM(1, "cm", "cm"), /** * The 'Mm' literal object. * * * @see #MM_VALUE * @generated * @ordered */ MM(2, "mm", "mm"); /** * The 'M' literal value. * *

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

* * @see #M * @model name="m" * @generated * @ordered */ public static final int M_VALUE = 0; /** * The 'Cm' literal value. * *

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

* * @see #CM * @model name="cm" * @generated * @ordered */ public static final int CM_VALUE = 1; /** * The 'Mm' literal value. * *

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

* * @see #MM * @model name="mm" * @generated * @ordered */ public static final int MM_VALUE = 2; /** * An array of all the 'Length Unit Kind' enumerators. * * * @generated */ private static final LengthUnitKind[] VALUES_ARRAY = new LengthUnitKind[] { M, CM, MM, }; /** * A public read-only list of all the 'Length Unit Kind' enumerators. * * * @generated */ public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the 'Length Unit Kind' literal with the specified literal value. * * * @generated */ public static LengthUnitKind get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { LengthUnitKind result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the 'Length Unit Kind' literal with the specified name. * * * @generated */ public static LengthUnitKind getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { LengthUnitKind result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the 'Length Unit Kind' literal with the specified integer value. * * * @generated */ public static LengthUnitKind get(int value) { switch (value) { case M_VALUE: return M; case CM_VALUE: return CM; case MM_VALUE: return MM; } 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 LengthUnitKind(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; } } //LengthUnitKind