-
- Type Parameters:
T- The type managed by theRow.
- All Superinterfaces:
Collection<T>,Iterable<T>,List<T>
- All Known Implementing Classes:
RowImpl
public interface Row<T> extends List<T>
ARowholds multiple data elements loosely coupled to aHeader. As aRowjust contains a list of data elements with no keys (names) directly associated to the elements, aHeaderwith the according list of key (name) and type definitions is required to give aRowits semantics.In terms of a CSV file, a
Rowrepresents a single line of comma separated values. TheHeaderstands for the header line (top line) of the CSV file. The semantics for the content of aRowis provided by the accordingHeader.Many
Rowinstances are contained in aRowsinstance which in turn requires a singleHeaderto give all the therein containedRowinstances their semantics (in terms of key (name) and type information).In contrast to a
Row, aRecordrelates an element field with a key (name), calledField.In contrast to a
Record, aRowdoes not relate a key (name) to its values. To do this, aHeaderis required. Similar to aRecord, aRowmakes use ofColumninstances (provided by aHeaderinstance) to give the fields additional semantics.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tget(Header<T> aHeader, String aKey)This method retrieves a value from the row by taking the index of the according column in the header of the given key (the one with the given key) and returns that value.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
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
-
get
T get(Header<T> aHeader, String aKey) throws HeaderMismatchException, ColumnMismatchException
This method retrieves a value from the row by taking the index of the according column in the header of the given key (the one with the given key) and returns that value. This is possible as the values in the row and in the header have an order. This method is used as a convenience delegate byHeader.get(Row, String).- Parameters:
aHeader- The header being the reference for retrieval of the value by the given key.aKey- The key for which to retrieve the value.- Returns:
- The value in the row representing the key in the header.
- 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 theHeader.ColumnMismatchException- in case the type defined in the column for that key does not match the type in the row identified by the given key.
-
-