Package org.refcodes.tabular
Interface Header<T>
-
- Type Parameters:
T
- The type managed by theHeader
.
- All Superinterfaces:
org.refcodes.structure.Clearable
,java.util.Collection<Column<? extends T>>
,ColumnRow<T,Column<? extends T>>
,HeaderRow<T,Column<? extends T>>
,java.lang.Iterable<Column<? extends T>>
,org.refcodes.structure.Keys<java.lang.String,Column<? extends T>>
,org.refcodes.structure.Keys.MutableKeys<java.lang.String,Column<? extends T>>
,java.util.List<Column<? extends T>>
- All Known Implementing Classes:
HeaderImpl
public interface Header<T> extends HeaderRow<T,Column<? extends T>>
A list ofColumn
instances, for example describing the elements of a CSV file (visually speaking the of the CSV file's header line), is represented by theHeader
. TheHeader
preserves an order for a list ofColumn
instances. AHeader
provides the semantics for relatedRow
instances.The
Keys.keySet()
method must provide a predictable order as ensured by theLinkedHashSet
class as of the ordered nature of theHeader
.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default java.lang.String[]
toKeys()
Returns the keys of theHeader
in the intended order.default java.lang.Class<T>
toType()
default T[]
toValues(Record<T> aRecord)
Returns an array of the values stored by theRecord
in the order as defined by the header.-
Methods inherited from interface org.refcodes.tabular.ColumnRow
containsValue, withColumns
-
Methods inherited from interface org.refcodes.tabular.HeaderRow
fromStorageString, fromStorageString, fromStorageStringRecord, fromStorageStringRow, fromStorageStrings, fromStorageStrings, fromStorageStringsRecord, fromStorageStringsRow, indexOf, toPrintable, toPrintable, toPrintableRecord, toPrintableRow, toRecord, toRecordIgnoreType, toRow, toRowIgnoreType, toStorageString, toStorageString, toStorageStringRecord, toStorageStringRow, toStorageStrings, toStorageStrings, toStorageStringsRecord, toStorageStringsRow
-
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
-
toKeys
default java.lang.String[] toKeys()
Returns the keys of theHeader
in the intended order.- Returns:
- The keys of the
Header
in correct order.
-
toValues
default T[] toValues(Record<T> aRecord)
Returns an array of the values stored by theRecord
in the order as defined by the header.- Parameters:
aRecord
- TheRecord
to be converted to an array of values.- Returns:
- The array of values.
-
-