Package org.refcodes.tabular
Class AbstractHeader<T,C extends Column<? extends T>>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<C>
-
- org.refcodes.tabular.AbstractHeader<T,C>
-
- Type Parameters:
T- The type managed by theHeader.C- the generic type
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<C>,java.util.Collection<C>,java.util.List<C>,java.util.RandomAccess,org.refcodes.structure.Clearable,org.refcodes.structure.Keys<java.lang.String,C>,org.refcodes.structure.Keys.MutableKeys<java.lang.String,C>,ColumnsTemplate<T,C>,HeaderTemplate<T,C>
- Direct Known Subclasses:
FormattedHeaderImpl,HeaderImpl
public abstract class AbstractHeader<T,C extends Column<? extends T>> extends java.util.ArrayList<C> implements HeaderTemplate<T,C>, java.lang.Cloneable
Implementation of theHeaderinterface beingCloneable.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractHeader()Constructs theAbstractHeaderinstance.AbstractHeader(C... aHeader)Constructs theAbstractHeaderinstance configured with the providedColumninstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int aIndex, C aColumn)booleanadd(C aColumn)booleancontainsKey(java.lang.Object aKey)Cdelete(java.lang.String aKey)Record<T>fromStorageString(Record<java.lang.String> aStringRecord)A specialColumnimplementation might provide its own text exchange format for the given objects.Row<T>fromStorageString(Row<java.lang.String> aStringRow)A specialColumnimplementation might provide its own text exchange format for the given objects.Row<T>fromStorageStringRecord(Record<java.lang.String> aStringRecord)A specialColumnimplementation might provide its own text exchange format for the given objects.Record<T>fromStorageStringRow(Row<java.lang.String> aStringRow)A specialColumnimplementation might provide its own text exchange format for the given objects.Record<T>fromStorageStrings(Record<java.lang.String[]> aStringsRecord)A specialColumnimplementation might provide its own text exchange format for the given objects.Row<T>fromStorageStrings(Row<java.lang.String[]> aStringsRow)A specialColumnimplementation might provide its own text exchange format for the given objects.Row<T>fromStorageStringsRecord(Record<java.lang.String[]> aStringsRecord)A specialColumnimplementation might provide its own text exchange format for the given objects.Record<T>fromStorageStringsRow(Row<java.lang.String[]> aStringsRow)A specialColumnimplementation might provide its own text exchange format for the given objects.Cget(java.lang.Object aKey)intindexOf(java.lang.String aKey)Determines the index of the column with the given key or -1 if there is none such column.java.util.Set<java.lang.String>keySet()Record<java.lang.String>toPrintable(Record<? extends T> aRecord)To printable.Row<java.lang.String>toPrintable(Row<? extends T> aRow)To printable.Record<java.lang.String>toPrintableRecord(Row<? extends T> aRow)A specialColumnimplementation might provide its own printable format of the given objects; for example a human readable text representation of the value (or in very specialized cases even enriched with ANSI Escape-Codes).Row<java.lang.String>toPrintableRow(Record<? extends T> aRecord)To printable row.Record<T>toRecord(Row<? extends T> aRow)To record.Record<?>toRecordIgnoreType(Row<?> aRow)Similar toHeaderTemplate.toRecord(Row)with the difference that conversion is done ignoring the type of theHeaderTemplateColumninstances and the according value(s).Row<T>toRow(Record<? extends T> aRecord)To row.Row<?>toRowIgnoreType(Record<?> aRecord)Similar toHeaderTemplate.toRow(Record)with the difference that conversion is done ignoring the type of theHeaderTemplateColumninstances and the according value(s).Record<java.lang.String>toStorageString(Record<? extends T> aRecord)To storage string.Row<java.lang.String>toStorageString(Row<? extends T> aRow)To storage string.Record<java.lang.String>toStorageStringRecord(Row<? extends T> aRow)A specialColumnimplementation might provide its own text exchange format for the given objects.Row<java.lang.String>toStorageStringRow(Record<? extends T> aRecord)A specialColumnimplementation might provide its own text exchange format for the given objects.Record<java.lang.String[]>toStorageStrings(Record<? extends T> aRecord)To storage strings.Row<java.lang.String[]>toStorageStrings(Row<? extends T> aRow)To storage strings.Record<java.lang.String[]>toStorageStringsRecord(Row<? extends T> aRow)A specialColumnimplementation might provide its own text exchange format for the given objects.Row<java.lang.String[]>toStorageStringsRow(Record<? extends T> aRecord)A specialColumnimplementation might provide its own text exchange format for the given objects.java.util.Collection<C>values()-
Methods inherited from class java.util.ArrayList
addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from interface org.refcodes.tabular.ColumnsTemplate
containsValue, withColumns
-
-
-
-
Constructor Detail
-
AbstractHeader
public AbstractHeader()
Constructs theAbstractHeaderinstance.
-
AbstractHeader
@SafeVarargs public AbstractHeader(C... aHeader)
Constructs theAbstractHeaderinstance configured with the providedColumninstances.- Parameters:
aHeader- TheColumninstances to be contained in theAbstractHeaderin the order as passed.
-
-
Method Detail
-
containsKey
public boolean containsKey(java.lang.Object aKey)
-
get
public C get(java.lang.Object aKey)
-
keySet
public java.util.Set<java.lang.String> keySet()
-
indexOf
public int indexOf(java.lang.String aKey)
Determines the index of the column with the given key or -1 if there is none such column.
-
delete
public C delete(java.lang.String aKey)
-
toStorageString
public Record<java.lang.String> toStorageString(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
To storage string.- Specified by:
toStorageStringin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRecord- the record- Returns:
- the record
- Throws:
HeaderMismatchException- the header mismatch exceptionColumnMismatchException- the column mismatch exception
-
toStorageString
public Row<java.lang.String> toStorageString(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
To storage string.- Specified by:
toStorageStringin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRow- the row- Returns:
- the row
- Throws:
HeaderMismatchException- the header mismatch exceptionColumnMismatchException- the column mismatch exception
-
fromStorageString
public Record<T> fromStorageString(Record<java.lang.String> aStringRecord) throws HeaderMismatchException, java.text.ParseException
A specialColumnimplementation might provide its own text exchange format for the given objects. This method enables theHeaderTemplateto convert aRecordcontaining onlyStringobjects to aRecordwith the given types and viaHeaderTemplate.toStorageString(Record)back to theStringRecord(bijective). This method may use aColumninstance's methodColumn.fromStorageString(String).- Specified by:
fromStorageStringin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aStringRecord- theStringRecordto be converted to a typeRecord.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenColumnsand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.java.text.ParseException- in case parsing the input was not possible
-
fromStorageString
public Row<T> fromStorageString(Row<java.lang.String> aStringRow) throws HeaderMismatchException, java.text.ParseException
A specialColumnimplementation might provide its own text exchange format for the given objects. This method enables theHeaderTemplateto convert aRowcontaining onlyStringobjects to aRowwith the given types and viaHeaderTemplate.toStorageString(Row)back to theStringRow(bijective). This method may use aColumninstance's methodColumn.fromStorageString(String).- Specified by:
fromStorageStringin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aStringRow- theStringRowto be converted to a typeRow.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.java.text.ParseException- in case parsing the input was not possible
-
toStorageStrings
public Record<java.lang.String[]> toStorageStrings(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
To storage strings.- Specified by:
toStorageStringsin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRecord- the record- Returns:
- the record
- Throws:
HeaderMismatchException- the header mismatch exceptionColumnMismatchException- the column mismatch exception
-
toStorageStrings
public Row<java.lang.String[]> toStorageStrings(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
To storage strings.- Specified by:
toStorageStringsin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRow- the row- Returns:
- the row
- Throws:
HeaderMismatchException- the header mismatch exceptionColumnMismatchException- the column mismatch exception
-
fromStorageStrings
public Row<T> fromStorageStrings(Row<java.lang.String[]> aStringsRow) throws HeaderMismatchException, java.text.ParseException
A specialColumnimplementation might provide its own text exchange format for the given objects. This method enables theHeaderTemplateto convert aRowcontaining onlyStringobjects to aRowwith the given types and viaHeaderTemplate.toStorageStrings(Row)back to theStringarrayRow(bijective). This method may use aColumninstance's methodColumn.fromStorageStrings(String[]). SupportingStringarrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry).- Specified by:
fromStorageStringsin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aStringsRow- theStringarrayRowto be converted to a typeRow.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.java.text.ParseException- in case parsing the input was not possible
-
fromStorageStrings
public Record<T> fromStorageStrings(Record<java.lang.String[]> aStringsRecord) throws HeaderMismatchException, java.text.ParseException
A specialColumnimplementation might provide its own text exchange format for the given objects. This method enables theHeaderTemplateto convert aRecordcontaining onlyStringobjects to aRecordwith the given types and viaHeaderTemplate.toStorageStrings(Record)back to theStringRecord(bijective). This method may use aColumninstance's methodColumn.fromStorageStrings(String[]). SupportingStringarrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry).- Specified by:
fromStorageStringsin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aStringsRecord- theStringarrayRecordto be converted to a typeRecord.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenColumnsand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.java.text.ParseException- in case parsing the input was not possible
-
toPrintable
public Record<java.lang.String> toPrintable(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
To printable.- Specified by:
toPrintablein interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRecord- the record- Returns:
- the record
- Throws:
HeaderMismatchException- the header mismatch exceptionColumnMismatchException- the column mismatch exception
-
toPrintable
public Row<java.lang.String> toPrintable(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
To printable.- Specified by:
toPrintablein interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRow- the row- Returns:
- the row
- Throws:
HeaderMismatchException- the header mismatch exceptionColumnMismatchException- the column mismatch exception
-
toRow
public Row<T> toRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
To row.- Specified by:
toRowin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRecord- the record- Returns:
- the row
- Throws:
HeaderMismatchException- the header mismatch exceptionColumnMismatchException- the column mismatch exception
-
toRowIgnoreType
public Row<?> toRowIgnoreType(Record<?> aRecord) throws HeaderMismatchException
Similar toHeaderTemplate.toRow(Record)with the difference that conversion is done ignoring the type of theHeaderTemplateColumninstances and the according value(s).- Specified by:
toRowIgnoreTypein interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRecord- TheRecordto use when creating theRow.- Returns:
- The
Rowaccording to theColumninstances of theHeaderTemplate. - Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.
-
toRecord
public Record<T> toRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
To record.- Specified by:
toRecordin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRow- the row- Returns:
- the record
- Throws:
HeaderMismatchException- the header mismatch exceptionColumnMismatchException- the column mismatch exception
-
toRecordIgnoreType
public Record<?> toRecordIgnoreType(Row<?> aRow) throws HeaderMismatchException
Similar toHeaderTemplate.toRecord(Row)with the difference that conversion is done ignoring the type of theHeaderTemplateColumninstances and the according value(s).- Specified by:
toRecordIgnoreTypein interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRow- TheRecordto use when creating theRecord.- Returns:
- The
Rowaccording to theColumninstances of theHeaderTemplate. - Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.
-
fromStorageStringRecord
public Row<T> fromStorageStringRecord(Record<java.lang.String> aStringRecord) throws HeaderMismatchException, java.text.ParseException
A specialColumnimplementation might provide its own text exchange format for the given objects. This method enables theHeaderTemplateto convert aRecordcontaining onlyStringobjects to aRowwith the given types and viaHeaderTemplate.toStorageStringRecord(Row)back to theStringRecord(bijective). This method may use aColumninstance's methodColumn.fromStorageString(String).- Specified by:
fromStorageStringRecordin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aStringRecord- theStringRecordto be converted to a typeRow.- Returns:
- The type
Rowrepresentation of theStringRecord. - Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.java.text.ParseException- in case parsing the input was not possible
-
toStorageStringRecord
public Record<java.lang.String> toStorageStringRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
A specialColumnimplementation might provide its own text exchange format for the given objects. This method enables theHeaderTemplateto convert aRowof the given type to aRecordcontaining onlyStringvalues and viaHeaderTemplate.fromStorageStringRecord(Record)back to the actualRow(bijective). This method may use aColumninstance's methodColumn.toStorageString(Object). ------------------------------------------------------------------------- TODO !!! STILL TO BE TESTED !!! -------------------------------------------------------------------------- Specified by:
toStorageStringRecordin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRow- TheRowto be converted to aStringRecord.- Returns:
- The
Stringrepresentation of the value. - Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.ColumnMismatchException- Thrown in case a value was found in the e.g. in aRowof the wrong type than specified by aColumnof theHeaderTemplate.
-
fromStorageStringRow
public Record<T> fromStorageStringRow(Row<java.lang.String> aStringRow) throws HeaderMismatchException, java.text.ParseException
A specialColumnimplementation might provide its own text exchange format for the given objects. This method enables theHeaderTemplateto convert aRowcontaining onlyStringobjects to aRecordwith the given types and viaHeaderTemplate.toStorageStringRow(Record)back to theStringRow(bijective). This method may use aColumninstance's methodColumn.fromStorageString(String).- Specified by:
fromStorageStringRowin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aStringRow- theStringRowto be converted to a typeRecord.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.java.text.ParseException- in case parsing the input was not possible
-
toStorageStringRow
public Row<java.lang.String> toStorageStringRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
A specialColumnimplementation might provide its own text exchange format for the given objects. This method enables theHeaderTemplateto convert aRecordof the given type to aRowcontaining onlyStringvalues and viaHeaderTemplate.fromStorageStringRecord(Record)back to the actualRecord(bijective). This method may use aColumninstance's methodColumn.toStorageString(Object). ------------------------------------------------------------------------- TODO !!! STILL TO BE TESTED !!! -------------------------------------------------------------------------- Specified by:
toStorageStringRowin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRecord- TheRowto be converted to aStringRecord.- Returns:
- The
Stringrepresentation of the value. - Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.ColumnMismatchException- Thrown in case a value was found in the e.g. in aRecordof the wrong type than specified by aColumnof theHeaderTemplate.
-
fromStorageStringsRecord
public Row<T> fromStorageStringsRecord(Record<java.lang.String[]> aStringsRecord) throws HeaderMismatchException, java.text.ParseException
A specialColumnimplementation might provide its own text exchange format for the given objects. This method enables theHeaderTemplateto convert aRecordcontaining onlyStringarrays to aRowwith the given types and viaHeaderTemplate.toStorageStringsRecord(Row)back to theStringRecord(bijective). This method may use aColumninstance's methodColumn.fromStorageStrings(String[]). SupportingStringarrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry).- Specified by:
fromStorageStringsRecordin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aStringsRecord- theStringRecordto be converted to a typeRow.- Returns:
- The type
Rowrepresentation of theStringRecord. - Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.java.text.ParseException- in case parsing the input was not possible
-
toStorageStringsRecord
public Record<java.lang.String[]> toStorageStringsRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
A specialColumnimplementation might provide its own text exchange format for the given objects. This method enables theHeaderTemplateto convert aRowof the given type to aRecordcontaining onlyStringarrays and viaHeaderTemplate.fromStorageStringsRecord(Record)back to the actualRow(bijective). This method may use aColumninstance's methodColumn.toStorageStrings(Object). SupportingStringarrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry). ------------------------------------------------------------------------- TODO !!! STILL TO BE TESTED !!! -------------------------------------------------------------------------- Specified by:
toStorageStringsRecordin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRow- TheRowto be converted to aStringRecord.- Returns:
- The
Stringrepresentation of the value. - Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.ColumnMismatchException- Thrown in case a value was found in the e.g. in aRowof the wrong type than specified by aColumnof theHeaderTemplate.
-
fromStorageStringsRow
public Record<T> fromStorageStringsRow(Row<java.lang.String[]> aStringsRow) throws HeaderMismatchException, java.text.ParseException
A specialColumnimplementation might provide its own text exchange format for the given objects. This method enables theHeaderTemplateto convert aRowcontaining onlyStringarrays to aRecordwith the given types and viaHeaderTemplate.toStorageStringsRow(Record)back to theStringRow(bijective). This method may use aColumninstance's methodColumn.fromStorageStrings(String[]). SupportingStringarrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry).- Specified by:
fromStorageStringsRowin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aStringsRow- theStringRowto be converted to a typeRecord.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.java.text.ParseException- in case parsing the input was not possible
-
toStorageStringsRow
public Row<java.lang.String[]> toStorageStringsRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
A specialColumnimplementation might provide its own text exchange format for the given objects. This method enables theHeaderTemplateto convert aRecordof the given type to aRowcontaining onlyStringarrays and viaHeaderTemplate.fromStorageStringsRecord(Record)back to the actualRecord(bijective). This method may use aColumninstance's methodColumn.toStorageStrings(Object). SupportingStringarrays enables to address data sinks which support multiple values in one filed (for example some NoSQL databases such as Amazon's simple DB supports multiple values in one row's entry). ------------------------------------------------------------------------- TODO !!! STILL TO BE TESTED !!! -------------------------------------------------------------------------- Specified by:
toStorageStringsRowin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRecord- TheRowto be converted to aStringRecord.- Returns:
- The
Stringrepresentation of the value. - Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.ColumnMismatchException- Thrown in case a value was found in the e.g. in aRecordof the wrong type than specified by aColumnof theHeaderTemplate.
-
toPrintableRow
public Row<java.lang.String> toPrintableRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
To printable row.- Specified by:
toPrintableRowin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRecord- the record- Returns:
- the row
- Throws:
HeaderMismatchException- the header mismatch exceptionColumnMismatchException- the column mismatch exception
-
toPrintableRecord
public Record<java.lang.String> toPrintableRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
A specialColumnimplementation might provide its own printable format of the given objects; for example a human readable text representation of the value (or in very specialized cases even enriched with ANSI Escape-Codes). This method enables theHeaderTemplateto convert aRowof the given type to a human readable textRecord. The human readable text, in comparison to the methodHeaderTemplate.toStorageString(Row)(orHeaderTemplate.toRecordIgnoreType(Row)) is not intended to be converted back to the actual value (not bijective). This method may use aColumninstance's methodColumn.toPrintable(Object); it also might enrich the output of theColumn.toPrintable(Object)with device specific additional data such as ANSI Escape-Codes and with information regarding theRowas a whole and not just be regarding a single value. ------------------------------------------------------------------------- TODO !!! STILL TO BE TESTED !!! -------------------------------------------------------------------------- Specified by:
toPrintableRecordin interfaceHeaderTemplate<T,C extends Column<? extends T>>- Parameters:
aRow- theRowto be converted to a human readable textRecord.- Returns:
- The human readable
Recordrepresentation of theRow. - Throws:
HeaderMismatchException- Thrown in case there is a mismatch between the givenHeaderMismatchExceptionand theRow, i.e. the index for the given key in the header may be out of index of the given row or the given key does not exist in theHeaderTemplate.ColumnMismatchException- Thrown in case a value was found in the e.g. in aRowof the wrong type than specified by aColumnof theHeaderTemplate.
-
add
public boolean add(C aColumn)
-
add
public void add(int aIndex, C aColumn)
-
-