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.lang.Cloneable
,java.lang.Iterable<T>
,java.util.Collection<T>
,java.util.List<T>
,org.refcodes.structure.Clearable
,org.refcodes.structure.Keys<T,C>
,org.refcodes.structure.Keys.MutableKeys<T,C>
,ColumnRow<T,C>
,HeaderRow<T,C>
- Direct Known Subclasses:
FormattedHeaderImpl
,HeaderImpl
public abstract class AbstractHeader<T,C extends Column<? extends T>> extends java.util.ArrayList<C> implements HeaderRow<T,C>, java.lang.Cloneable
Implementation of theHeader
interface beingCloneable
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractHeader()
Constructs theAbstractHeader
instance.AbstractHeader(C... aHeader)
Constructs theAbstractHeader
instance configured with the providedColumn
instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int aIndex, C aColumn)
boolean
add(C aColumn)
boolean
containsKey(java.lang.Object aKey)
C
delete(java.lang.String aKey)
Record<T>
fromStorageString(Record<java.lang.String> aStringRecord)
A specialColumn
implementation might provide its own text exchange format for the given objects.Row<T>
fromStorageString(Row<java.lang.String> aStringRow)
A specialColumn
implementation might provide its own text exchange format for the given objects.Row<T>
fromStorageStringRecord(Record<java.lang.String> aStringRecord)
A specialColumn
implementation might provide its own text exchange format for the given objects.Record<T>
fromStorageStringRow(Row<java.lang.String> aStringRow)
A specialColumn
implementation might provide its own text exchange format for the given objects.Record<T>
fromStorageStrings(Record<java.lang.String[]> aStringsRecord)
A specialColumn
implementation might provide its own text exchange format for the given objects.Row<T>
fromStorageStrings(Row<java.lang.String[]> aStringsRow)
A specialColumn
implementation might provide its own text exchange format for the given objects.Row<T>
fromStorageStringsRecord(Record<java.lang.String[]> aStringsRecord)
A specialColumn
implementation might provide its own text exchange format for the given objects.Record<T>
fromStorageStringsRow(Row<java.lang.String[]> aStringsRow)
A specialColumn
implementation might provide its own text exchange format for the given objects.C
get(java.lang.Object aKey)
int
indexOf(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 specialColumn
implementation 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 toHeaderRow.toRecord(Row)
with the difference that conversion is done ignoring the type of theHeaderRow
Column
instances and the according value(s).Row<T>
toRow(Record<? extends T> aRecord)
To row.Row<?>
toRowIgnoreType(Record<?> aRecord)
Similar toHeaderRow.toRow(Record)
with the difference that conversion is done ignoring the type of theHeaderRow
Column
instances 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 specialColumn
implementation might provide its own text exchange format for the given objects.Row<java.lang.String>
toStorageStringRow(Record<? extends T> aRecord)
A specialColumn
implementation 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 specialColumn
implementation might provide its own text exchange format for the given objects.Row<java.lang.String[]>
toStorageStringsRow(Record<? extends T> aRecord)
A specialColumn
implementation 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.ColumnRow
containsValue, withColumns
-
Methods inherited from interface java.util.List
addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Field Detail
-
_keys
protected java.util.Set<java.lang.String> _keys
ALinkedHashSet
is used in order to preserve the order of the elements as contained in theHeader
itself.
-
-
Constructor Detail
-
AbstractHeader
public AbstractHeader()
Constructs theAbstractHeader
instance.
-
AbstractHeader
@SafeVarargs public AbstractHeader(C... aHeader)
Constructs theAbstractHeader
instance configured with the providedColumn
instances.- Parameters:
aHeader
- TheColumn
instances to be contained in theAbstractHeader
in 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:
toStorageString
in interfaceHeaderRow<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:
toStorageString
in interfaceHeaderRow<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 specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
containing onlyString
objects to aRecord
with the given types and viaHeaderRow.toStorageString(Record)
back to theString
Record
(bijective). This method may use aColumn
instance's methodColumn.fromStorageString(String)
.- Specified by:
fromStorageString
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aStringRecord
- theString
Record
to be converted to a typeRecord
.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenColumns
and 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 theHeaderRow
.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 specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
containing onlyString
objects to aRow
with the given types and viaHeaderRow.toStorageString(Row)
back to theString
Row
(bijective). This method may use aColumn
instance's methodColumn.fromStorageString(String)
.- Specified by:
fromStorageString
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aStringRow
- theString
Row
to be converted to a typeRow
.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.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:
toStorageStrings
in interfaceHeaderRow<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:
toStorageStrings
in interfaceHeaderRow<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 specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
containing onlyString
objects to aRow
with the given types and viaHeaderRow.toStorageStrings(Row)
back to theString
arrayRow
(bijective). This method may use aColumn
instance's methodColumn.fromStorageStrings(String[])
. SupportingString
arrays 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:
fromStorageStrings
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aStringsRow
- theString
arrayRow
to be converted to a typeRow
.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.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 specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
containing onlyString
objects to aRecord
with the given types and viaHeaderRow.toStorageStrings(Record)
back to theString
Record
(bijective). This method may use aColumn
instance's methodColumn.fromStorageStrings(String[])
. SupportingString
arrays 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:
fromStorageStrings
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aStringsRecord
- theString
arrayRecord
to be converted to a typeRecord
.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenColumns
and 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 theHeaderRow
.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:
toPrintable
in interfaceHeaderRow<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:
toPrintable
in interfaceHeaderRow<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:
toRow
in interfaceHeaderRow<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 toHeaderRow.toRow(Record)
with the difference that conversion is done ignoring the type of theHeaderRow
Column
instances and the according value(s).- Specified by:
toRowIgnoreType
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aRecord
- TheRecord
to use when creating theRow
.- Returns:
- The
Row
according to theColumn
instances of theHeaderRow
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.
-
toRecord
public Record<T> toRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
To record.- Specified by:
toRecord
in interfaceHeaderRow<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 toHeaderRow.toRecord(Row)
with the difference that conversion is done ignoring the type of theHeaderRow
Column
instances and the according value(s).- Specified by:
toRecordIgnoreType
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aRow
- TheRecord
to use when creating theRecord
.- Returns:
- The
Row
according to theColumn
instances of theHeaderRow
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.
-
fromStorageStringRecord
public Row<T> fromStorageStringRecord(Record<java.lang.String> aStringRecord) throws HeaderMismatchException, java.text.ParseException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
containing onlyString
objects to aRow
with the given types and viaHeaderRow.toStorageStringRecord(Row)
back to theString
Record
(bijective). This method may use aColumn
instance's methodColumn.fromStorageString(String)
.- Specified by:
fromStorageStringRecord
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aStringRecord
- theString
Record
to be converted to a typeRow
.- Returns:
- The type
Row
representation of theString
Record
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.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 specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
of the given type to aRecord
containing onlyString
values and viaHeaderRow.fromStorageStringRecord(Record)
back to the actualRow
(bijective). This method may use aColumn
instance's methodColumn.toStorageString(Object)
. ------------------------------------------------------------------------- TODO !!! STILL TO BE TESTED !!! -------------------------------------------------------------------------- Specified by:
toStorageStringRecord
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aRow
- TheRow
to be converted to aString
Record
.- Returns:
- The
String
representation of the value. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRow
of the wrong type than specified by aColumn
of theHeaderRow
.
-
fromStorageStringRow
public Record<T> fromStorageStringRow(Row<java.lang.String> aStringRow) throws HeaderMismatchException, java.text.ParseException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
containing onlyString
objects to aRecord
with the given types and viaHeaderRow.toStorageStringRow(Record)
back to theString
Row
(bijective). This method may use aColumn
instance's methodColumn.fromStorageString(String)
.- Specified by:
fromStorageStringRow
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aStringRow
- theString
Row
to be converted to a typeRecord
.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.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 specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
of the given type to aRow
containing onlyString
values and viaHeaderRow.fromStorageStringRecord(Record)
back to the actualRecord
(bijective). This method may use aColumn
instance's methodColumn.toStorageString(Object)
. ------------------------------------------------------------------------- TODO !!! STILL TO BE TESTED !!! -------------------------------------------------------------------------- Specified by:
toStorageStringRow
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aRecord
- TheRow
to be converted to aString
Record
.- Returns:
- The
String
representation of the value. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRecord
of the wrong type than specified by aColumn
of theHeaderRow
.
-
fromStorageStringsRecord
public Row<T> fromStorageStringsRecord(Record<java.lang.String[]> aStringsRecord) throws HeaderMismatchException, java.text.ParseException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
containing onlyString
arrays to aRow
with the given types and viaHeaderRow.toStorageStringsRecord(Row)
back to theString
Record
(bijective). This method may use aColumn
instance's methodColumn.fromStorageStrings(String[])
. SupportingString
arrays 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:
fromStorageStringsRecord
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aStringsRecord
- theString
Record
to be converted to a typeRow
.- Returns:
- The type
Row
representation of theString
Record
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.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 specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
of the given type to aRecord
containing onlyString
arrays and viaHeaderRow.fromStorageStringsRecord(Record)
back to the actualRow
(bijective). This method may use aColumn
instance's methodColumn.toStorageStrings(Object)
. SupportingString
arrays 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:
toStorageStringsRecord
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aRow
- TheRow
to be converted to aString
Record
.- Returns:
- The
String
representation of the value. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRow
of the wrong type than specified by aColumn
of theHeaderRow
.
-
fromStorageStringsRow
public Record<T> fromStorageStringsRow(Row<java.lang.String[]> aStringsRow) throws HeaderMismatchException, java.text.ParseException
A specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRow
containing onlyString
arrays to aRecord
with the given types and viaHeaderRow.toStorageStringsRow(Record)
back to theString
Row
(bijective). This method may use aColumn
instance's methodColumn.fromStorageStrings(String[])
. SupportingString
arrays 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:
fromStorageStringsRow
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aStringsRow
- theString
Row
to be converted to a typeRecord
.- Returns:
- The type representation of the value.
- Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.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 specialColumn
implementation might provide its own text exchange format for the given objects. This method enables theHeaderRow
to convert aRecord
of the given type to aRow
containing onlyString
arrays and viaHeaderRow.fromStorageStringsRecord(Record)
back to the actualRecord
(bijective). This method may use aColumn
instance's methodColumn.toStorageStrings(Object)
. SupportingString
arrays 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:
toStorageStringsRow
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aRecord
- TheRow
to be converted to aString
Record
.- Returns:
- The
String
representation of the value. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRecord
of the wrong type than specified by aColumn
of theHeaderRow
.
-
toPrintableRow
public Row<java.lang.String> toPrintableRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
To printable row.- Specified by:
toPrintableRow
in interfaceHeaderRow<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 specialColumn
implementation 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 theHeaderRow
to convert aRow
of the given type to a human readable textRecord
. The human readable text, in comparison to the methodHeaderRow.toStorageString(Row)
(orHeaderRow.toRecordIgnoreType(Row)
) is not intended to be converted back to the actual value (not bijective). This method may use aColumn
instance'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 theRow
as a whole and not just be regarding a single value. ------------------------------------------------------------------------- TODO !!! STILL TO BE TESTED !!! -------------------------------------------------------------------------- Specified by:
toPrintableRecord
in interfaceHeaderRow<T,C extends Column<? extends T>>
- Parameters:
aRow
- theRow
to be converted to a human readable textRecord
.- Returns:
- The human readable
Record
representation of theRow
. - Throws:
HeaderMismatchException
- Thrown in case there is a mismatch between the givenHeaderMismatchException
and 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 theHeaderRow
.ColumnMismatchException
- Thrown in case a value was found in the e.g. in aRow
of the wrong type than specified by aColumn
of theHeaderRow
.
-
add
public boolean add(C aColumn)
-
add
public void add(int aIndex, C aColumn)
-
-