public abstract class AbstractEnumerator extends java.lang.Object implements Enumerator, java.io.Serializable
Modifier | Constructor and Description |
---|---|
protected |
AbstractEnumerator(int value,
java.lang.String name)
Creates an initialized instance.
|
protected |
AbstractEnumerator(int value,
java.lang.String name,
java.lang.String literal)
Creates an initialized instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getLiteral()
Returns the literal value of the enumerator.
|
java.lang.String |
getName()
Returns the name of the enumerator.
|
int |
getValue()
Returns the
int value of the enumerator. |
java.lang.String |
toString()
Returns the literal value of the enumerator, which is its string representation.
|
protected java.lang.Object |
writeReplace() |
protected AbstractEnumerator(int value, java.lang.String name)
value
- the int
value of the enumerator.name
- the name of the enumerator, which is also used as the literal value.protected AbstractEnumerator(int value, java.lang.String name, java.lang.String literal)
value
- the int
value of the enumerator.name
- the name of the enumerator.literal
- the literal value of the enumerator.public final java.lang.String getName()
getName
in interface Enumerator
public final int getValue()
int
value of the enumerator.getValue
in interface Enumerator
public final java.lang.String getLiteral()
getLiteral
in interface Enumerator
public final java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.Object writeReplace() throws java.io.ObjectStreamException
java.io.ObjectStreamException