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
FieldsModifier and TypeFieldDescriptionprotected ObjectListContains the descriptions for the values of this enumeration type.static final EnumerationTypeAn "abstract" base enumeration type which is used as supertype for those enumeration types which useints to encode their values.static final EnumerationTypeAn "abstract" base enumeration type which is used as supertype for those enumeration types which useObjects to encode their values.protected ObjectListContains the values of this enumeration type.Fields inherited from class de.grogra.reflect.MemberBase
annots, declaringType, descriptor, modifiers, nameFields inherited from interface de.grogra.reflect.Member
ABSTRACT, ACCESS_MODIFIERS, ARRAY, BRIDGE, CONSTANT, FINAL, GLOBAL, INTERFACE, JAVA_MODIFIERS, LOCAL_CLASS, MIN_UNUSED_MODIFIER, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILEFields 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
ConstructorsConstructorDescriptionEnumerationType(String name, I18NBundle bundle, int count) Creates a newEnumerationTypeconsisting ofcountvalues of typeintbeginning with 0.EnumerationType(String name, I18NBundle bundle, String[] suffixes) Creates a newEnumerationTypeconsisting ofkeys.lengthvalues of typeintbeginning with 0.EnumerationType(String name, I18NBundle bundle, String[] suffixes, Object[] values, Type implType) EnumerationType(String name, Object[] values, EnumerationType superType, Type implType) Creates a newEnumerationTypeconsisting ofvalues.lengthvalues, their type being determined bysupertype/code>.EnumerationType(String name, String[] descriptions) Creates a newEnumerationTypeconsisting ofdescriptions.lengthvalues of typeintbeginning with 0. -
Method Summary
Modifier and TypeMethodDescriptionvoidgetDescriptionFor(Object value) getElementAt(int index) intgetSize()getValueFor(Object description) booleanvoidMethods inherited from class de.grogra.reflect.TypeImpl
cloneObject, createArray, getArrayType, getBinaryName, getComponentType, getDeclaredField, getDeclaredFieldCount, getDeclaredInterface, getDeclaredInterfaceCount, getDeclaredMethod, getDeclaredMethodCount, getDeclaredType, getDeclaredTypeCount, getDefaultElementValue, getLookup, getPackage, getSignature, getSimpleName, getSupertype, getTypeId, getTypeLoader, isInstance, newInstance, toStringMethods inherited from class de.grogra.reflect.MemberBase
getDeclaredAnnotation, getDeclaredAnnotationCount, getDeclaringType, getDescriptor, getModifiers, getNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 useints to encode their values. -
OBJECT_ENUMERATION
An "abstract" base enumeration type which is used as supertype for those enumeration types which useObjects 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 newEnumerationTypeconsisting ofvalues.lengthvalues, 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 newEnumerationTypeconsisting ofdescriptions.lengthvalues of typeintbeginning 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 newEnumerationTypeconsisting ofkeys.lengthvalues of typeintbeginning with 0. The representation of the values is obtained from the specified resourcebundleusing thesuffixes: The keys for thebundleare 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 newEnumerationTypeconsisting ofcountvalues of typeintbeginning with 0. The representation of the values is obtained from the specified resourcebundle: The used key for valueiisname.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:
getImplementationClassin interfaceType- Overrides:
getImplementationClassin classTypeImpl
-
getElementAt
- Specified by:
getElementAtin interfaceListModel
-
getSize
public int getSize() -
getDescriptionFor
-
getValueFor
-
addListDataListener
- Specified by:
addListDataListenerin interfaceListModel
-
removeListDataListener
- Specified by:
removeListDataListenerin interfaceListModel
-
isStringSerializable
public boolean isStringSerializable()- Specified by:
isStringSerializablein interfaceType- Overrides:
isStringSerializablein classTypeImpl
-
valueOf
-