Interface Row<T>

  • Type Parameters:
    T - The type managed by the Row.
    All Superinterfaces:
    java.util.Collection<T>, java.lang.Iterable<T>, java.util.List<T>
    All Known Implementing Classes:
    RowImpl


    public interface Row<T>
    extends java.util.List<T>
    A Row holds multiple data elements loosely coupled to a Header. As a Row just contains a list of data elements with no keys (names) directly associated to the elements, a Header with the according list of key (name) and type definitions is required to give a Row its semantics.

    In terms of a CSV file, a Row represents a single line of comma separated values. The Header stands for the header line (top line) of the CSV file. The semantics for the content of a Row is provided by the according Header.

    Many Row instances are contained in a Rows instance which in turn requires a single Header to give all the therein contained Row instances their semantics (in terms of key (name) and type information).

    In contrast to a Row, a Record relates an element field with a key (name), called Field.

    In contrast to a Record, a Row does not relate a key (name) to its values. To do this, a Header is required. Similar to a Record, a Row makes use of Column instances (provided by a Header instance) to give the fields additional semantics.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T get​(Header<T> aHeader, java.lang.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
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        add, add, 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
    • Method Detail

      • get

        T get​(Header<T> aHeader,
              java.lang.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. ------------------------------------------------------------------------- TODO: Think about moving this method into the Header (as down with Column.get(Record)). -------------------------------------------------------------------------
        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 given HeaderMismatchException and the Row, 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 the Header.
        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.