Package org.refcodes.tabular
Class RowImpl<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- org.refcodes.tabular.RowImpl<T>
-
- Type Parameters:
T
- The type managed by theRow
.
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Iterable<T>
,java.util.Collection<T>
,java.util.List<T>
,Row<T>
public class RowImpl<T> extends java.util.ArrayList<T> implements Row<T>, java.lang.Cloneable
Implementation of theRow
interface beingCloneable
.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete 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 class java.util.ArrayList
add, add, 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 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
public 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 theHeader
(as down withColumn.get(Record)
). -------------------------------------------------------------------------- Specified by:
get
in interfaceRow<T>
- 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 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 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.
-
-