java.lang.Object
de.grogra.reflect.MemberBase
de.grogra.reflect.TypeImpl
de.grogra.util.EnumerationType
An
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).- Author:
- Ole Kniemeyer
-
Field Summary
Modifier and TypeFieldDescriptionprotected ObjectList
Contains the descriptions for the values of this enumeration type.static final EnumerationType
An "abstract" base enumeration type which is used as supertype for those enumeration types which useint
s to encode their values.static final EnumerationType
An "abstract" base enumeration type which is used as supertype for those enumeration types which useObject
s to encode their values.protected ObjectList
Contains the values of this enumeration type.Fields inherited from class de.grogra.reflect.MemberBase
annots, declaringType, descriptor, modifiers, name
Fields inherited from interface de.grogra.reflect.Member
ABSTRACT, 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
Fields inherited from interface de.grogra.reflect.Type
BOOLEAN, 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, VOID
-
Constructor Summary
ConstructorDescriptionEnumerationType
(String name, I18NBundle bundle, int count) Creates a newEnumerationType
consisting ofcount
values of typeint
beginning with 0.EnumerationType
(String name, I18NBundle bundle, String[] suffixes) Creates a newEnumerationType
consisting ofkeys.length
values of typeint
beginning with 0.EnumerationType
(String name, I18NBundle bundle, String[] suffixes, Object[] values, Type implType) EnumerationType
(String name, Object[] values, EnumerationType superType, Type implType) Creates a newEnumerationType
consisting ofvalues.length
values, their type being determined bysupertype/code>.
EnumerationType
(String name, String[] descriptions) Creates a newEnumerationType
consisting ofdescriptions.length
values of typeint
beginning with 0. -
Method Summary
Modifier and TypeMethodDescriptionvoid
getDescriptionFor
(Object value) getElementAt
(int index) int
getSize()
getValueFor
(Object description) boolean
void
Methods inherited from class de.grogra.reflect.TypeImpl
cloneObject, createArray, getArrayType, getBinaryName, getComponentType, getDeclaredField, getDeclaredFieldCount, getDeclaredInterface, getDeclaredInterfaceCount, getDeclaredMethod, getDeclaredMethodCount, getDeclaredType, getDeclaredTypeCount, getDefaultElementValue, getLookup, getPackage, getSimpleName, getSupertype, getTypeId, getTypeLoader, isInstance, newInstance, toString
Methods inherited from class de.grogra.reflect.MemberBase
getDeclaredAnnotation, getDeclaredAnnotationCount, getDeclaringType, getDescriptor, getModifiers, getName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.grogra.reflect.Member
getDeclaredAnnotation, getDeclaredAnnotationCount, getDeclaringType, getDescriptor, getModifiers, getName
-
Field Details
-
INT_ENUMERATION
An "abstract" base enumeration type which is used as supertype for those enumeration types which useint
s to encode their values. -
OBJECT_ENUMERATION
An "abstract" base enumeration type which is used as supertype for those enumeration types which useObject
s to encode their values. -
values
Contains the values of this enumeration type. -
descriptions
Contains the descriptions for the values of this enumeration type.
-
-
Constructor Details
-
EnumerationType
Creates a newEnumerationType
consisting ofvalues.length
values, their type being determined bysupertype/code>.
- Parameters:
name
- a name for the typevalues
- the representation of the enumeration valuessuperType
- the supertypeimplType
- the class of the internal values
-
EnumerationType
Creates a newEnumerationType
consisting ofdescriptions.length
values of typeint
beginning with 0. A string representation of the values is obtained from the specifieddescriptions
.- Parameters:
name
- a name for the typedescriptions
- strings to represent the values
-
EnumerationType
Creates a newEnumerationType
consisting ofkeys.length
values of typeint
beginning with 0. The representation of the values is obtained from the specified resourcebundle
using thesuffixes
: The keys for thebundle
are the concatenationsname + '.' + suffixes[i]
.- Parameters:
name
- a name for the typebundle
- the resource bundle to obtain representations for the valuessuffixes
- the suffixes to use for the resource bundle
-
EnumerationType
public EnumerationType(String name, I18NBundle bundle, String[] suffixes, Object[] values, Type implType) -
EnumerationType
Creates a newEnumerationType
consisting ofcount
values of typeint
beginning with 0. The representation of the values is obtained from the specified resourcebundle
: The used key for valuei
isname.i
.- Parameters:
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 enumeration
-
-
Method Details
-
getImplementationClass
- Specified by:
getImplementationClass
in interfaceType
- Overrides:
getImplementationClass
in classTypeImpl
-
getElementAt
- Specified by:
getElementAt
in interfaceListModel
-
getSize
public int getSize() -
getDescriptionFor
-
getValueFor
-
addListDataListener
- Specified by:
addListDataListener
in interfaceListModel
-
removeListDataListener
- Specified by:
removeListDataListener
in interfaceListModel
-
isStringSerializable
public boolean isStringSerializable()- Specified by:
isStringSerializable
in interfaceType
- Overrides:
isStringSerializable
in classTypeImpl
-
valueOf
-