Class DateColumn
- All Implemented Interfaces:
Cloneable, KeyAccessor<String>, TypeAccessor<Date>, Column<Date>
DateColumn implements the Column with support for the
Date type and various default or custom date formats.-
Nested Class Summary
Nested classes/interfaces inherited from interface KeyAccessor
KeyAccessor.KeyBuilder<K,B>, KeyAccessor.KeyMutator<K>, KeyAccessor.KeyProperty<K> Nested classes/interfaces inherited from interface TypeAccessor
TypeAccessor.TypeBuilder<T,B>, TypeAccessor.TypeMutator<T>, TypeAccessor.TypeProperty<T> -
Constructor Summary
ConstructorsConstructorDescriptionDateColumn(String aKey) Constructor of theDateColumnwith support for the defaultSimpleDateFormatinstances as defined in theDateFormats.DEFAULT_DATE_FORMATS.DateColumn(String aKey, DateTimeFormatter... aDateFormats) Constructor of theDateColumnwith support for the providedSimpleDateFormatinstances. -
Method Summary
Modifier and TypeMethodDescriptionclone()fromStorageStrings(String[] aStringValues) AColumnimplementation can provide its own text exchange format for the given objects.toPrintable(Date aValue) AColumnimplementation can provide its own printable format of the given objects; for example a human readable text representation of the value (or in very https://www.metacodes.proized cases even enriched with ANSI escape codes).String[]toStorageStrings(Date aValue) AColumnimplementation can provide its own text exchange format for the given objects.Methods inherited from class AbstractColumn
contains, fromStorageString, get, getKey, getType, remove, toStorageStringMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Column
getValue, toStorageString_
-
Constructor Details
-
DateColumn
Constructor of theDateColumnwith support for the defaultSimpleDateFormatinstances as defined in theDateFormats.DEFAULT_DATE_FORMATS.- Parameters:
aKey- The key to be used.
-
DateColumn
Constructor of theDateColumnwith support for the providedSimpleDateFormatinstances.- Parameters:
aKey- The key to be used.aDateFormats- TheSimpleDateFormatinstances used for parsing date strings.
-
-
Method Details
-
toStorageStrings
AColumnimplementation can provide its own text exchange format for the given objects. This method enables theColumnto convert a value of the given type to aStringarray 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 storageStringrepresentations of the elements in that array may be placed in dedicated entries of the returnedStringarray. In case T is not an array type then the returnedStringarray 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. -
fromStorageStrings
AColumnimplementation can provide its own text exchange format for the given objects. This method enables theColumnto convert aStringarray value to a value of the given type and viaColumn.toStorageStrings(Object)back to theStringarray (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 storageStringrepresentations of the elements in that array may be placed in dedicated entries of the providedStringarray. In case T is not an array type then the passedStringarray 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.- Parameters:
aStringValues- The value to be converted to a type instance.- Returns:
- The type representation of the value.
- Throws:
ParseException- in case parsing theStringwas not possible
-
toPrintable
AColumnimplementation can provide its own printable format of the given objects; for example a human readable text representation of the value (or in very https://www.metacodes.proized cases even enriched with ANSI escape codes). This method enables theColumnto convert a value of the given type to a human readable text. The human readable text, in comparison to the methodObject.toString()(orColumn.toStorageString(Object)) is not intended to be converted back to the actual value (not bijective). This method may be used aHeaderinstance's methodHeaderRow.toPrintable(Record).- Specified by:
toPrintablein interfaceColumn<Date>- Overrides:
toPrintablein classAbstractColumn<Date>- Parameters:
aValue- the element to be converted to a human readable text.- Returns:
- The human readable representation of the value.
-
clone
- Overrides:
clonein classAbstractColumn<Date>- Throws:
CloneNotSupportedException
-