org.eclipse.emf.common.util
Class AbstractEnumerator

java.lang.Object
  extended by org.eclipse.emf.common.util.AbstractEnumerator
All Implemented Interfaces:
java.io.Serializable, Enumerator

public abstract class AbstractEnumerator
extends java.lang.Object
implements Enumerator, java.io.Serializable

An extensible enumerator implementation.

See Also:
Serialized Form

Nested Class Summary
private static class AbstractEnumerator.AbstractEnumeratorExternalizeable
           
 
Field Summary
private  java.lang.String literal
          The literal value of the enumerator.
private  java.lang.String name
          The name of the enumerator.
private  int value
          The int value of the enumerator.
 
Constructor Summary
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.
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private final java.lang.String name
The name of the enumerator.


value

private final int value
The int value of the enumerator.


literal

private final java.lang.String literal
The literal value of the enumerator.

Constructor Detail

AbstractEnumerator

protected AbstractEnumerator(int value,
                             java.lang.String name)
Creates an initialized instance.

Parameters:
value - the int value of the enumerator.
name - the name of the enumerator, which is also used as the literal value.

AbstractEnumerator

protected AbstractEnumerator(int value,
                             java.lang.String name,
                             java.lang.String literal)
Creates an initialized instance.

Parameters:
value - the int value of the enumerator.
name - the name of the enumerator.
literal - the literal value of the enumerator.
Method Detail

getName

public final java.lang.String getName()
Returns the name of the enumerator.

Specified by:
getName in interface Enumerator
Returns:
the name.

getValue

public final int getValue()
Returns the int value of the enumerator.

Specified by:
getValue in interface Enumerator
Returns:
the value.

getLiteral

public final java.lang.String getLiteral()
Returns the literal value of the enumerator.

Specified by:
getLiteral in interface Enumerator
Returns:
the literal.

toString

public final java.lang.String toString()
Returns the literal value of the enumerator, which is its string representation.

Overrides:
toString in class java.lang.Object
Returns:
the literal.

writeReplace

protected java.lang.Object writeReplace()
                                 throws java.io.ObjectStreamException
Throws:
java.io.ObjectStreamException


Copyright © 2001-2010 Eclipse Foundation. All Rights Reserved.