org.obe.util
Class AbstractEnum

java.lang.Object
  extended byorg.obe.util.AbstractEnum
All Implemented Interfaces:
java.lang.Comparable, Enum, java.io.Serializable
Direct Known Subclasses:
AccessLevel, AutomationMode, BasicType, ConditionType, DataTypes, DurationUnit, ExceptionCode, ExecutionType, GraphConformance, ImplementationType, InstantiationType, JoinType, ParameterMode, ParticipantType, PublicationStatus, ResponseRequiredType, SplitType, TemporalStatus, ToolMode, ToolType

public abstract class AbstractEnum
extends java.lang.Object
implements Enum

An abstract base implementation for enumerated types. This class is very similar to the primordial generic Enum class described by JDK 1.5:

public abstract class Enum <T extends Enum<T>>
implements Comparable<T>, Serializable

Author:
Adrian Price
See Also:
Serialized Form

Field Summary
 java.lang.String name
           
 int ordinal
           
 
Constructor Summary
protected AbstractEnum(java.lang.String name, int ordinal)
           
 
Method Summary
protected static java.util.List clinit(AbstractEnum[] values, java.util.Map tagMap)
          Used by subclasses to initialize their static list and map fields.
protected  java.lang.Object clone()
           
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
protected  java.lang.Object readResolve()
           
 java.lang.String toString()
           
 int value()
          Returns the ordinal value.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.obe.util.Enum
family
 

Field Detail

name

public final java.lang.String name

ordinal

public final int ordinal
Constructor Detail

AbstractEnum

protected AbstractEnum(java.lang.String name,
                       int ordinal)
Method Detail

clinit

protected static java.util.List clinit(AbstractEnum[] values,
                                       java.util.Map tagMap)
Used by subclasses to initialize their static list and map fields.

Parameters:
values - The complete set of enum values.
tagMap - The map-by-name to initialize.
Returns:
An unmodifiable list of enumerated values, in declaration order.

clone

protected final java.lang.Object clone()
                                throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

compareTo

public final int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

equals

public final boolean equals(java.lang.Object obj)

hashCode

public final int hashCode()

readResolve

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

toString

public final java.lang.String toString()

value

public final int value()
Description copied from interface: Enum
Returns the ordinal value.

Specified by:
value in interface Enum
Returns:
Ordinal value.


SourceForge.net Logo OBE-1.0 Copyright (c) 2002-2006 Adrian Price. All Rights Reserved.