dsto.dfc.util
Class AbstractEnumerationValue
java.lang.Object
dsto.dfc.util.AbstractEnumerationValue
- All Implemented Interfaces:
- EnumerationValue, Serializable
- Direct Known Subclasses:
- StringEnumerationValue
public abstract class AbstractEnumerationValue
- extends Object
- implements EnumerationValue, Serializable
Base class for enumerated types. Provides sensible default for equals() as
well as intelligent serialization support via a readResolve () that resolves
serialized enum values to their equivalent singleton instance in
getEnumValues (). Superclasses that wish to use this feature must provide
a readResolve() implementation that calls super.readResolve().
- Version:
- $Revision$
- See Also:
- Serialized Form
AbstractEnumerationValue
public AbstractEnumerationValue()
getEnumValues
public abstract EnumerationValue[] getEnumValues()
- Description copied from interface:
EnumerationValue
- Get the list of values within the enumeration.
- Specified by:
getEnumValues
in interface EnumerationValue
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
findIndex
public int findIndex()
findIndex
public static int findIndex(EnumerationValue value)
readResolve
protected Object readResolve()
throws InvalidObjectException
- Serialization support: resolves instance written to stream to the
equivalent instance in getEnumValues () using equals (). Superclasses
that wish to use this feature must override this method and call
super.readResolve ().
- Throws:
InvalidObjectException
- if value could not be resolved
to a valid entry in the list of enum values.
Copyright © 2008 Commonwealth of Australia