org.eclipse.emf.common.util
Class AbstractEnumerator

java.lang.Object
  extended byorg.eclipse.emf.common.util.AbstractEnumerator
All Implemented Interfaces:
Enumerator
Direct Known Subclasses:
ChangeKind, GenDelegationKind, GenPropertyKind, GenProviderKind, GenResourceKind, SpaceType

public abstract class AbstractEnumerator
extends Object
implements Enumerator

An extensible enumerator implementation.


Constructor Summary
protected AbstractEnumerator(int value, String name)
          Creates an initialized instance.
protected AbstractEnumerator(int value, String name, String literal)
          Creates an initialized instance.
 
Method Summary
 String getLiteral()
          Returns the literal value of the enumerator.
 String getName()
          Returns the name of the enumerator.
 int getValue()
          Returns the int value of the enumerator.
 String toString()
          Returns the literal value of the enumerator, which is its string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractEnumerator

protected AbstractEnumerator(int value,
                             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,
                             String name,
                             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 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 String getLiteral()
Returns the literal value of the enumerator.

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

toString

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

Returns:
the literal.

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.