de.grogra.util
public class EnumerationType extends TypeImpl implements javax.swing.ListModel
EnumerationType is a type whose values are drawn
from an enumeration. The enumeration type is either integral
(consecutive int values beginning with 0) or a
reference type (a set of Object values).| Modifier and Type | Field and Description |
|---|---|
protected ObjectList |
descriptions
Contains the descriptions for the values of this enumeration type.
|
static EnumerationType |
INT_ENUMERATION
An "abstract" base enumeration type which is used as supertype
for those enumeration types which use
ints
to encode their values. |
static EnumerationType |
OBJECT_ENUMERATION
An "abstract" base enumeration type which is used as supertype
for those enumeration types which use
Objects
to encode their values. |
protected ObjectList |
values
Contains the values of this enumeration type.
|
annots, declaringType, descriptor, modifiers, nameBOOLEAN, BYTE, CHAR, CLASS, DOUBLE, FLOAT, FLOATING_POINT, INT, INTEGRAL, INVALID, LOCAL_CLASS_MODIFIERS, LONG, MEMBER_CLASS_MODIFIERS, MEMBER_INTERFACE_MODIFIERS, NULL, NUMBER, NUMERIC, OBJECT, SHORT, STRING, TEXTAREA, TOP_LEVEL_CLASS_MODIFIERS, TOP_LEVEL_INTERFACE_MODIFIERS, TYPE, TYPE_0, VOIDABSTRACT, ACCESS_MODIFIERS, ARRAY, BRIDGE, CONSTANT, FINAL, INTERFACE, JAVA_MODIFIERS, LOCAL_CLASS, MIN_UNUSED_MODIFIER, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE| Constructor and Description |
|---|
EnumerationType(java.lang.String name,
I18NBundle bundle,
int count)
Creates a new
EnumerationType consisting of
count values of type int beginning with 0. |
EnumerationType(java.lang.String name,
I18NBundle bundle,
java.lang.String[] suffixes)
Creates a new
EnumerationType consisting of
keys.length values of type int beginning
with 0. |
EnumerationType(java.lang.String name,
I18NBundle bundle,
java.lang.String[] suffixes,
java.lang.Object[] values,
Type implType) |
EnumerationType(java.lang.String name,
java.lang.Object[] values,
EnumerationType superType,
Type implType)
Creates a new
EnumerationType consisting of
values.length values, their type being
determined by supertype/code>. |
EnumerationType(java.lang.String name,
java.lang.String[] descriptions)
Creates a new
EnumerationType consisting of
descriptions.length values of type int beginning
with 0. |
| Modifier and Type | Method and Description |
|---|---|
void |
addListDataListener(javax.swing.event.ListDataListener l) |
java.lang.Object |
getDescriptionFor(java.lang.Object value) |
java.lang.Object |
getElementAt(int index) |
java.lang.Class |
getImplementationClass() |
int |
getSize() |
java.lang.Object |
getValueFor(java.lang.Object description) |
boolean |
isStringSerializable() |
void |
removeListDataListener(javax.swing.event.ListDataListener l) |
java.lang.Object |
valueOf(java.lang.String s) |
cloneObject, createArray, getArrayType, getBinaryName, getComponentType, getDeclaredField, getDeclaredFieldCount, getDeclaredInterface, getDeclaredInterfaceCount, getDeclaredMethod, getDeclaredMethodCount, getDeclaredType, getDeclaredTypeCount, getDefaultElementValue, getLookup, getPackage, getSimpleName, getSupertype, getTypeId, getTypeLoader, isInstance, newInstance, toStringgetDeclaredAnnotation, getDeclaredAnnotationCount, getDeclaringType, getDescriptor, getModifiers, getNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDeclaredAnnotation, getDeclaredAnnotationCount, getDeclaringType, getDescriptor, getModifiers, getNameprotected ObjectList descriptions
public static final EnumerationType INT_ENUMERATION
ints
to encode their values.public static final EnumerationType OBJECT_ENUMERATION
Objects
to encode their values.protected ObjectList values
public EnumerationType(java.lang.String name,
I18NBundle bundle,
int count)
EnumerationType consisting of
count values of type int beginning with 0. The
representation of the values is obtained from the specified
resource bundle: The used key for value i
is name.i.name - the base name for the keys and the name of the typebundle - the resource bundle to obtain representations for the valuescount - the number of values of this enumerationpublic EnumerationType(java.lang.String name,
I18NBundle bundle,
java.lang.String[] suffixes)
EnumerationType consisting of
keys.length values of type int beginning
with 0. The representation of the values is obtained from the
specified resource bundle using the suffixes:
The keys for the bundle are the concatenations
name + '.' + suffixes[i].name - a name for the typebundle - the resource bundle to obtain representations for the valuessuffixes - the suffixes to use for the resource bundlepublic EnumerationType(java.lang.String name,
I18NBundle bundle,
java.lang.String[] suffixes,
java.lang.Object[] values,
Type implType)
public EnumerationType(java.lang.String name,
java.lang.Object[] values,
EnumerationType superType,
Type implType)
EnumerationType consisting of
values.length values, their type being
determined by supertype/code>.name - a name for the typevalues - the representation of the enumeration valuessuperType - the supertypeimplType - the class of the internal valuespublic EnumerationType(java.lang.String name,
java.lang.String[] descriptions)
EnumerationType consisting of
descriptions.length values of type int beginning
with 0. A string representation of the values is obtained from the
specified descriptions.name - a name for the typedescriptions - strings to represent the valuespublic void addListDataListener(javax.swing.event.ListDataListener l)
addListDataListener in interface javax.swing.ListModelpublic java.lang.Object getDescriptionFor(java.lang.Object value)
public java.lang.Object getElementAt(int index)
getElementAt in interface javax.swing.ListModelpublic java.lang.Class getImplementationClass()
getImplementationClass in interface TypegetImplementationClass in class TypeImplpublic int getSize()
getSize in interface javax.swing.ListModelpublic java.lang.Object getValueFor(java.lang.Object description)
public boolean isStringSerializable()
isStringSerializable in interface TypeisStringSerializable in class TypeImplpublic void removeListDataListener(javax.swing.event.ListDataListener l)
removeListDataListener in interface javax.swing.ListModel