Package org.refcodes.tabular
Interface HeaderTemplate<T,C extends Column<? extends T>>
-
- Type Parameters:
T- The type managed by theHeaderTemplate.C- the generic type
- All Superinterfaces:
org.refcodes.structure.Clearable,java.util.Collection<C>,ColumnsTemplate<T,C>,java.lang.Iterable<C>,org.refcodes.structure.Keys<java.lang.String,C>,org.refcodes.structure.Keys.MutableKeys<java.lang.String,C>,java.util.List<C>
- All Known Subinterfaces:
FormattedHeader<T>,Header<T>
- All Known Implementing Classes:
AbstractHeader,FormattedHeaderImpl,HeaderImpl
public interface HeaderTemplate<T,C extends Column<? extends T>> extends ColumnsTemplate<T,C>, java.util.List<C>
A list ofColumninstances, for example describing the elements of a CSV file (visually speaking the of the CSV file's header line), is represented by theHeaderTemplate. TheHeaderTemplatepreserves an order for a list ofColumninstances. AHeaderTemplateprovides the semantics for relatedRowinstances.The
Keys.keySet()method must provide a predictable order as ensured by theLinkedHashSetclass as of the ordered nature of theHeaderTemplate.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.intindexOf(java.lang.String aKey)Determines the index of the column with the given key or -1 if there is none such column.Record<java.lang.String>toPrintable(Record<? extends T> aRecord)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>toPrintable(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).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)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).Record<T>toRecord(Row<? extends T> aRow)Record<?>toRecordIgnoreType(Row<?> aRow)Similar totoRecord(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)Row<?>toRowIgnoreType(Record<?> aRecord)Similar totoRow(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)A specialColumnimplementation might provide its own text exchange format for the given objects.Row<java.lang.String>toStorageString(Row<? extends T> aRow)A specialColumnimplementation might provide its own text exchange format for the given objects.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)A specialColumnimplementation might provide its own text exchange format for the given objects.Row<java.lang.String[]>toStorageStrings(Row<? extends T> aRow)A specialColumnimplementation might provide its own text exchange format for the given objects.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.-
Methods inherited from interface org.refcodes.tabular.ColumnsTemplate
containsValue, withColumns
-
Methods inherited from interface org.refcodes.structure.Keys
containsKey, get, get, keySet, use, values
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Method Detail
-
indexOf
int indexOf(java.lang.String aKey)
Determines the index of the column with the given key or -1 if there is none such column.- Parameters:
aKey- The key for which to get the column index.- Returns:
- The index or -1 if there is none such column.
-
toRow
Row<T> toRow(Record<? extends T> aRecord) throws HeaderMismatchException, ColumnMismatchException
Creates aRowof theRecordwith the values in the order of theHeaderTemplate. This method is kind of "strong typed" as any type mismatch between theColumndefined in theHeaderTemplateand the according value of theRecordwe get aColumnMismatchException.- 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.ColumnMismatchException- Thrown in case a value was found in the e.g. in aRecordof the wrong type than specified by aColumnof theHeaderTemplate.
-
toRowIgnoreType
Row<?> toRowIgnoreType(Record<?> aRecord) throws HeaderMismatchException
Similar totoRow(Record)with the difference that conversion is done ignoring the type of theHeaderTemplateColumninstances and the according value(s).- 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
Record<T> toRecord(Row<? extends T> aRow) throws HeaderMismatchException, ColumnMismatchException
Creates aRecordof theRowwith the values in the order of theHeaderTemplate. This method is kind of "strong typed" as any type mismatch between theColumndefined in theHeaderTemplateand the according value of theRowwe get aColumnMismatchException.- 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.ColumnMismatchException- Thrown in case a value was found in the e.g. in aRecordof the wrong type than specified by aColumnof theHeaderTemplate.
-
toRecordIgnoreType
Record<?> toRecordIgnoreType(Row<?> aRow) throws HeaderMismatchException
Similar totoRecord(Row)with the difference that conversion is done ignoring the type of theHeaderTemplateColumninstances and the according value(s).- 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.
-
toStorageString
Row<java.lang.String> toStorageString(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 aRowcontaining onlyStringvalues and viafromStorageString(Row)back to the actualRow(bijective). This method may use aColumninstance's methodColumn.toStorageString(Object).- Parameters:
aRow- theRowto be converted to aStringRow.- 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.
-
fromStorageString
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 viatoStorageString(Row)back to theStringRow(bijective). This method may use aColumninstance's methodColumn.fromStorageString(String).- 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 possiblejava.lang.UnsupportedOperationException- in case this operation is not supported.
-
toStorageString
Record<java.lang.String> toStorageString(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 aRecordcontaining onlyStringvalues and viafromStorageString(Record)back to the actualRecord(bijective). This method may use aColumninstance's methodColumn.toStorageString(Object).- Parameters:
aRecord- theRecordto be converted to aStringRecord.- Returns:
- The
Stringrepresentation 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.ColumnMismatchException- Thrown in case a value was found in the e.g. in aRecordof the wrong type than specified by aColumnof theHeaderTemplate.
-
fromStorageString
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 viatoStorageString(Record)back to theStringRecord(bijective). This method may use aColumninstance's methodColumn.fromStorageString(String).- 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 possiblejava.lang.UnsupportedOperationException- in case this operation is not supported.
-
toStorageStrings
Row<java.lang.String[]> toStorageStrings(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 aRowcontaining onlyStringarrays and viafromStorageStrings(Row)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).- Parameters:
aRow- theRowto be converted to aStringRow.- 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.
-
fromStorageStrings
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 viatoStorageStrings(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).- 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 possiblejava.lang.UnsupportedOperationException- in case this operation is not supported.
-
toStorageStrings
Record<java.lang.String[]> toStorageStrings(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 aRecordcontaining onlyStringarrays and viafromStorageStrings(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).- Parameters:
aRecord- theRecordto be converted to aStringRecord.- Returns:
- The
Stringrepresentation 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.ColumnMismatchException- Thrown in case a value was found in the e.g. in aRecordof the wrong type than specified by aColumnof theHeaderTemplate.
-
fromStorageStrings
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 viatoStorageStrings(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).- 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 possiblejava.lang.UnsupportedOperationException- in case this operation is not supported.
-
toPrintable
Record<java.lang.String> toPrintable(Record<? extends T> aRecord) 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 a value of the given type to a human readable text. The human readable text, in comparison to the methodtoStorageString(Record)(ortoStorageStrings(Record)) 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 theRecordas a whole and not just be regarding a single value.- Parameters:
aRecord- theRecordto be converted to a human readable textRecord.- Returns:
- The human readable representation of the
Record. - 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.ColumnMismatchException- Thrown in case a value was found in the e.g. in aRecordof the wrong type than specified by aColumnof theHeaderTemplate.
-
toPrintable
Row<java.lang.String> toPrintable(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 a value of the given type to a human readable text. The human readable text, in comparison to the methodtoStorageString(Row)(ortoStorageStrings(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.- Parameters:
aRow- theRowto be converted to a human readable textRow.- Returns:
- The human readable representation of the
Row. - 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.
-
fromStorageStringRecord
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 viatoStorageStringRecord(Row)back to theStringRecord(bijective). This method may use aColumninstance's methodColumn.fromStorageString(String).- Parameters:
aStringRecord- theStringRecordto be converted to a typeRow.- Returns:
- The type
Rowrepresentation of theStringRecord. - Throws:
java.text.ParseException- in case parsing the input was not possibleHeaderMismatchException- 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.
-
toStorageStringRecord
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 viafromStorageStringRecord(Record)back to the actualRow(bijective). This method may use aColumninstance's methodColumn.toStorageString(Object).- 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
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 viatoStorageStringRow(Record)back to theStringRow(bijective). This method may use aColumninstance's methodColumn.fromStorageString(String).- 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 possiblejava.lang.UnsupportedOperationException- in case this operation is not supported.
-
toStorageStringRow
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 viafromStorageStringRecord(Record)back to the actualRecord(bijective). This method may use aColumninstance's methodColumn.toStorageString(Object).- 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
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 viatoStorageStringsRecord(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).- 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
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 viafromStorageStringsRecord(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).- 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
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 viatoStorageStringsRow(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).- 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 possiblejava.lang.UnsupportedOperationException- in case this operation is not supported.
-
toStorageStringsRow
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 viafromStorageStringsRecord(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).- 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
Row<java.lang.String> toPrintableRow(Record<? extends T> aRecord) 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 a value of the given type to a human readable text. The human readable text, in comparison to the methodtoRow(Record)(ortoStorageStringsRecord(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 theRecordas a whole and not just be regarding a single value.- Parameters:
aRecord- theRecordto be converted to a human readable textRow.- Returns:
- The human readable
Rowrepresentation of theRecord. - 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.
-
toPrintableRecord
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 methodtoStorageString(Row)(ortoRecordIgnoreType(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.- 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.
-
-