Class AbstractColumn<T>

java.lang.Object
org.refcodes.tabular.AbstractColumn<T>
Type Parameters:
T - The type managed by the column.
All Implemented Interfaces:
Cloneable, org.refcodes.mixin.KeyAccessor<String>, org.refcodes.mixin.TypeAccessor<T>, Column<T>
Direct Known Subclasses:
BooleanColumn, DateColumn, DoubleColumn, EnumColumn, ExceptionColumn, FloatColumn, IntColumn, LongColumn, ObjectColumn, StringColumn, StringsColumn

public abstract class AbstractColumn<T> extends Object implements Column<T>, Cloneable
The AbstractColumn is the default implementation for the Column interface. It implements amongst others the toStorageString(Object) and fromStorageString(String) methods leaving the developer to implement in sub-classes only the two methods Column.toStorageStrings(Object) as well as Column.fromStorageStrings(String[]) which are to do the actual conversions.

Special care is taken when the type T is an array type:

The method toStorageString(Object) returns a String with separated values (in terms of CSV) in case the type T is an array type. The delimiter of the values in this String then is the Delimiter.ARRAY character as we use the Delimiter.CSV when embedding the returned String in a CSV list (file).

The method fromStorageString(String) interprets the passed String as separated values (in terms of CSV) in case the type T is an array type. It creates a String array from the String value; the delimiter of the values in the String used is the Delimiter.ARRAY character as we use the Delimiter.CSV when parsing a String in a CSV list (file).