Package org.eclipse.emf.common.util
Class AbstractEnumerator
java.lang.Object
org.eclipse.emf.common.util.AbstractEnumerator
- All Implemented Interfaces:
Serializable,Enumerator
An extensible enumerator implementation.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractEnumerator(int value, String name) Creates an initialized instance.protectedAbstractEnumerator(int value, String name, String literal) Creates an initialized instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringReturns the literal value of the enumerator.final StringgetName()Returns the name of the enumerator.final intgetValue()Returns theintvalue of the enumerator.final StringtoString()Returns the literal value of the enumerator, which is its string representation.protected Object
-
Constructor Details
-
AbstractEnumerator
Creates an initialized instance.- Parameters:
value- theintvalue of the enumerator.name- the name of the enumerator, which is also used as the literal value.
-
AbstractEnumerator
Creates an initialized instance.- Parameters:
value- theintvalue of the enumerator.name- the name of the enumerator.literal- the literal value of the enumerator.
-
-
Method Details
-
getName
Returns the name of the enumerator.- Specified by:
getNamein interfaceEnumerator- Returns:
- the name.
-
getValue
public final int getValue()Returns theintvalue of the enumerator.- Specified by:
getValuein interfaceEnumerator- Returns:
- the value.
-
getLiteral
Returns the literal value of the enumerator.- Specified by:
getLiteralin interfaceEnumerator- Returns:
- the literal.
-
toString
Returns the literal value of the enumerator, which is its string representation. -
writeReplace
- Throws:
ObjectStreamException
-