Package org.refcodes.tabular
Class StringsColumnImpl
- java.lang.Object
-
- org.refcodes.tabular.AbstractColumn<java.lang.String[]>
-
- org.refcodes.tabular.StringsColumnImpl
-
- All Implemented Interfaces:
java.lang.Cloneable,org.refcodes.mixin.KeyAccessor<java.lang.String>,org.refcodes.mixin.TypeAccessor<java.lang.String[]>,Column<java.lang.String[]>
public class StringsColumnImpl extends AbstractColumn<java.lang.String[]> implements java.lang.Cloneable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.KeyAccessor
org.refcodes.mixin.KeyAccessor.KeyBuilder<K extends java.lang.Object,B extends org.refcodes.mixin.KeyAccessor.KeyBuilder<K,B>>, org.refcodes.mixin.KeyAccessor.KeyMutator<K extends java.lang.Object>, org.refcodes.mixin.KeyAccessor.KeyProperty<K extends java.lang.Object>
-
-
Constructor Summary
Constructors Constructor Description StringsColumnImpl(java.lang.String aKey)Creates aStringsColumnImplmanagingStringarray instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()java.lang.String[]fromStorageStrings(java.lang.String[] aStringValues)AColumnimplementation can provide its own text exchange format for the given objects.java.lang.String[]toStorageStrings(java.lang.String[] aValue)AColumnimplementation 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
-
-
-
-
Constructor Detail
-
StringsColumnImpl
public StringsColumnImpl(java.lang.String aKey)
Creates aStringsColumnImplmanagingStringarray instances.- Parameters:
aKey- The key for theStringsColumnImpl.
-
-
Method Detail
-
toStorageStrings
public java.lang.String[] toStorageStrings(java.lang.String[] aValue)
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.- Specified by:
toStorageStringsin interfaceColumn<java.lang.String[]>- Parameters:
aValue- the element to be converted to aStringarray.- Returns:
- The
Stringarray representation of the value.
-
fromStorageStrings
public java.lang.String[] fromStorageStrings(java.lang.String[] aStringValues) throws java.text.ParseExceptionAColumnimplementation 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.- Specified by:
fromStorageStringsin interfaceColumn<java.lang.String[]>- Parameters:
aStringValues- The value to be converted to a type instance.- Returns:
- The type representation of the value.
- Throws:
java.text.ParseException- in case parsing theStringwas not possible
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classAbstractColumn<java.lang.String[]>- Throws:
java.lang.CloneNotSupportedException
-
-