|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectCodeList<E>
SimpleEnumerationType<E>
public abstract class SimpleEnumerationType<E extends SimpleEnumerationType<E>>
Class that implements simple, type safe enumerations in Java.
Two enumeration values are equal if e1 == e2 or if
e1.getValue() == e2.getValue().
CodeList.
Furthermore, according ISO 19103, enumeration and code list are not the same thing.
This base class is closer to a code list than an enumeration.| Constructor Summary | |
|---|---|
protected |
SimpleEnumerationType(Collection<E> values,
String name,
String description)
Add a new SimpleEnumerationType to the given list
using the given name and description. |
protected |
SimpleEnumerationType(Collection<E> values,
String name,
String description,
Icon icon)
Add a new SimpleEnumerationType to the given list
using the given name and description. |
| Method Summary | |
|---|---|
String |
getDescription()
Gets the description for this enumeration value. |
Icon |
getIcon()
Gets the icon for this enumeration value. |
static Icon |
getNullIcon()
Gets the null icon. |
protected static Icon |
loadIconResource(Class a_class,
String name)
Load an icon for this enumeration. |
String |
toString()
Gets the string representation of this object. |
| Methods inherited from class CodeList |
|---|
compareTo, family, name, ordinal, readResolve |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected SimpleEnumerationType(Collection<E> values,
String name,
String description)
SimpleEnumerationType to the given list
using the given name and description.
The icon will be set to the Null Icon.
values - the list of values to add to.name - the short name for the enum.description - the description for the enum.
protected SimpleEnumerationType(Collection<E> values,
String name,
String description,
Icon icon)
SimpleEnumerationType to the given list
using the given name and description.
values - the list of values to add to.name - the short name for the enum.description - the description for the enum.icon - the icon for the enum.| Method Detail |
|---|
protected static Icon loadIconResource(Class a_class,
String name)
loadIconResource loads the icon found
by a_class.getResource(name).
a_class - class to use to find icon resource.name - name of icon resource, for example, "SOLID.gif"
getNullIcon()public static Icon getNullIcon()
loadIconResource. The null icon is a
fixed size, 16x64, and its paint method simply returns.public String toString()
CodeList.name().
toString in class CodeList<E extends SimpleEnumerationType<E>>public String getDescription()
public Icon getIcon()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||