Package adams.core
Class ConfigurableEnumeration.AbstractItem<E extends ConfigurableEnumeration>
- java.lang.Object
-
- adams.core.ConfigurableEnumeration.AbstractItem<E>
-
- All Implemented Interfaces:
CloneHandler<ConfigurableEnumeration.AbstractItem>
,Serializable
,Comparable<ConfigurableEnumeration.AbstractItem>
- Direct Known Subclasses:
ExifTagEnum.Item
- Enclosing class:
- ConfigurableEnumeration<T extends ConfigurableEnumeration.AbstractItem>
public abstract static class ConfigurableEnumeration.AbstractItem<E extends ConfigurableEnumeration> extends Object implements Serializable, CloneHandler<ConfigurableEnumeration.AbstractItem>, Comparable<ConfigurableEnumeration.AbstractItem>
Represents a single item of an enumeration.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractItem(E enumeration, String id, String display)
Initializes the enum type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ConfigurableEnumeration.AbstractItem o)
Compares this item against the provided one.boolean
equals(Object obj)
Checks if the provided item is the same as this one.ConfigurableEnumeration.AbstractItem
getClone()
Returns a clone of the object.String
getDisplay()
Returns the display text.E
getEnumeration()
Returns the enumeration this item belongs to.String
getID()
Returns the ID.void
setEnumeration(E value)
Sets the owning enumeration.String
toString()
Just returns the display text.
-
-
-
Field Detail
-
m_Enumeration
protected E extends ConfigurableEnumeration m_Enumeration
the enumeration this item belongs to.
-
m_ID
protected String m_ID
the id.
-
m_Display
protected String m_Display
the (optional) display text.
-
-
Method Detail
-
setEnumeration
public void setEnumeration(E value)
Sets the owning enumeration.- Parameters:
value
- the enumeration
-
getEnumeration
public E getEnumeration()
Returns the enumeration this item belongs to.- Returns:
- the owner
-
getID
public String getID()
Returns the ID.- Returns:
- the ID
-
getDisplay
public String getDisplay()
Returns the display text.- Returns:
- the display text
-
getClone
public ConfigurableEnumeration.AbstractItem getClone()
Returns a clone of the object.- Specified by:
getClone
in interfaceCloneHandler<E extends ConfigurableEnumeration>
- Returns:
- the clone
-
compareTo
public int compareTo(ConfigurableEnumeration.AbstractItem o)
Compares this item against the provided one.- Specified by:
compareTo
in interfaceComparable<E extends ConfigurableEnumeration>
- Parameters:
o
- the item to compare against- Returns:
- less than, equal to, or greater than 0 if this item is less than, equal to, or greater than the provided item
-
equals
public boolean equals(Object obj)
Checks if the provided item is the same as this one.- Overrides:
equals
in classObject
- Parameters:
obj
- the object to check- Returns:
- true if the same
- See Also:
compareTo(AbstractItem)
-
-