- java.lang.Object
-
- org.refcodes.tabular.AbstractColumn<T>
-
- org.refcodes.tabular.EnumColumn<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.KeyAccessor
org.refcodes.mixin.KeyAccessor.KeyBuilder<K extends Object,B extends org.refcodes.mixin.KeyAccessor.KeyBuilder<K,B>>, org.refcodes.mixin.KeyAccessor.KeyMutator<K extends Object>, org.refcodes.mixin.KeyAccessor.KeyProperty<K extends Object>
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.TypeAccessor
org.refcodes.mixin.TypeAccessor.TypeBuilder<T extends Object,B extends org.refcodes.mixin.TypeAccessor.TypeBuilder<T,B>>, org.refcodes.mixin.TypeAccessor.TypeMutator<T extends Object>, org.refcodes.mixin.TypeAccessor.TypeProperty<T extends Object>
-
-
Constructor Summary
Constructors Constructor Description EnumColumn(String aKey, Class<T> aType)
Creates aEnumColumn
managingDouble
instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
T
fromStorageStrings(String[] aStringValues)
AColumn
implementation can provide its own text exchange format for the given objects.String[]
toStorageStrings(T aValue)
AColumn
implementation can provide its own text exchange format for the given objects.-
Methods inherited from class org.refcodes.tabular.AbstractColumn
contains, fromStorageString, get, getKey, getType, remove, toPrintable, toStorageString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.refcodes.tabular.Column
getValue, toStorageString_
-
-
-
-
Constructor Detail
-
EnumColumn
public EnumColumn(String aKey, Class<T> aType)
Creates aEnumColumn
managingDouble
instances.- Parameters:
aKey
- The key for theEnumColumn
.aType
- The enumeration's type.
-
-
Method Detail
-
toStorageStrings
public String[] toStorageStrings(T aValue)
AColumn
implementation can provide its own text exchange format for the given objects. This method enables theColumn
to convert a value of the given type to aString
array and viaColumn.fromStorageStrings(String[])
back to the value (bijective). This method supports data sinks (such as Amazon's SimpleDb) which provide dedicated support for multiple values in a row's entry: In case T is an array type, then the storageString
representations of the elements in that array may be placed in dedicated entries of the returnedString
array. In case T is not an array type then the returnedString
array may contain just one value. In case data sinks (such as relational databases) are to be addressed which allow only a single value in a row's entry, then the methodColumn.toStorageString(Object)
may be used instead. In case the enumeration implements theAliasAccessor
interface, then the according alias is the preferred storage string to be used.
-
fromStorageStrings
public T fromStorageStrings(String[] aStringValues) throws ParseException
AColumn
implementation can provide its own text exchange format for the given objects. This method enables theColumn
to convert aString
array value to a value of the given type and viaColumn.toStorageStrings(Object)
back to theString
array (bijective). This method supports data sinks (such as Amazon's SimpleDb) which provide dedicated support for multiple values in a row's entry: In case T is an array type, then the storageString
representations of the elements in that array may be placed in dedicated entries of the providedString
array. In case T is not an array type then the passedString
array may contain just one value. In case data sinks (such as relational databases) are to be addressed which allow only a single value in a row's entry, then the methodColumn.fromStorageString(String)
may be used instead. If possible, the enumeration's name is used for resolving the value. In case the enumeration implements theAliasAccessor
interface, then also the according alias is used for resolving the value. If both fails, the the storage string is interpreted as index pointing into the enumeration's values.- Specified by:
fromStorageStrings
in interfaceColumn<T extends Enum<T>>
- Parameters:
aStringValues
- The value to be converted to a type instance.- Returns:
- The type representation of the value.
- Throws:
ParseException
- in case parsing theString
was not possible
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clone
in classAbstractColumn<T extends Enum<T>>
- Throws:
CloneNotSupportedException
-
-