Class AbstractEnumerator

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

public abstract class AbstractEnumerator extends Object implements Enumerator, Serializable
An extensible enumerator implementation.
See Also:
  • Constructor Details

    • 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 Details

    • 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.
      Overrides:
      toString in class Object
      Returns:
      the literal.
    • writeReplace

      protected Object writeReplace() throws ObjectStreamException
      Throws:
      ObjectStreamException