public abstract class AbstractRowCollector extends java.lang.Object implements RowCollector
Abstract implementation of the RowCollector interface.
Provides functionality to collect rows into a list,
if they are validated by an abstract validation method.
Subclasses should implement RowCollector.isValidRow(int[]) method,
providing proper algorithm to validate incoming rows.
| Modifier and Type | Field and Description |
|---|---|
protected java.util.LinkedList<int[]> |
rows
Final list in which incoming valid rows will be collected.
|
| Constructor and Description |
|---|
AbstractRowCollector() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addRowIfValid(int[] row)
This method returns
true if specified row is valid and added to the collection,
or false otherwise. |
java.util.List<int[]> |
getRows()
Returns all the collected rows.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisValidRowprotected final java.util.LinkedList<int[]> rows
public boolean addRowIfValid(int[] row)
RowCollectorThis method returns true if specified row is valid and added to the collection,
or false otherwise.
If RowCollector.isValidRow(int[]) returns true for a specific row, then immediate call to this
method should also be successful for the same row (if no other rows were added inbetween method calls).
addRowIfValid in interface RowCollectorpublic java.util.List<int[]> getRows()
RowCollectorRowCollector.addRowIfValid(int[]) returned true should be
present in the result collection.getRows in interface RowCollector