org.eigenbase.util14
Class Enum14.BasicValue
java.lang.Object
org.eigenbase.util14.Enum14.BasicValue
- All Implemented Interfaces:
- Serializable, Comparable, Enum14.Value
- Direct Known Subclasses:
- Enum14.SerializableValue, FennelStandardTypeDescriptor, OptionsListTest.Color, SqlInsertKeyword, SqlKind, SqlSelectKeyword, UtilTest.UnserializableEnum
- Enclosing class:
- Enum14
public static class Enum14.BasicValue
- extends Object
- implements Enum14.Value, Serializable
BasicValue
is an obvious implementation of Enum14.Value
. This class is marked Serializable so that serializable
subclasses can be supported without requiring a default (no-argument)
constructor. However, note that while BasicValue
is marked
Serializable, deserialized instances will be new instances rather than
members of the original enumeration. In other words,
deserializedBasicValue == origBasicValue
will be false. Use Enum14.SerializableValue
for instances that deserialize into members of
the original enumeration so that deserializedBasicValue ==
origBasicValue
will be true.
- See Also:
- Serialized Form
serialVersionUID
private static final long serialVersionUID
- SerialVersionUID created with JDK 1.5 serialver tool.
- See Also:
- Constant Field Values
description
private final String description
name
private final String name
ordinal
private final int ordinal
Enum14.BasicValue
public Enum14.BasicValue(String name,
int ordinal,
String description)
- "Precondition:"
- name != null
getDescription
public String getDescription()
- Specified by:
getDescription
in interface Enum14.Value
getName
public String getName()
- Specified by:
getName
in interface Enum14.Value
getOrdinal
public int getOrdinal()
- Specified by:
getOrdinal
in interface Enum14.Value
equals
public boolean equals(String s)
- Deprecated. I bet you meant to write
value.name.equals(s)
rather than value.equals(s)
,
didn't you?
- Returns whether this value is equal to a given string.
equals
public final boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public final int hashCode()
- Overrides:
hashCode
in class Object
compareTo
public int compareTo(Object other)
- Specified by:
compareTo
in interface Comparable
toString
public String toString()
- Returns the value's name.
- Overrides:
toString
in class Object
unexpected
public Error unexpected()