Copyright © 2008-2011 Ralph Schuster. All Rights Reserved.

csv.impl
Class IndexRowFilter

java.lang.Object
  extended by csv.impl.AbstractRowFilter
      extended by csv.impl.IndexRowFilter
All Implemented Interfaces:
TableReader, java.util.Iterator<java.lang.Object[]>

public class IndexRowFilter
extends AbstractRowFilter

Implements a row filter based on row indices.

Author:
ralph

Constructor Summary
IndexRowFilter(TableReader reader, int[] validRowIndices)
          Constructor.
 
Method Summary
protected  boolean isMoreRowsExpected()
          This method returns false when all valid rows were delivered.
protected  boolean isValidRow(java.lang.Object[] row)
          Filters rows according to raw row index.
 void open()
          Opens this reader.
 void reset()
          Resets the reader.
 
Methods inherited from class csv.impl.AbstractRowFilter
close, findNextRow, get, getColumnIndex, getHeaderRow, getMinimumColumnCount, getRawRowIndex, getReader, getRowIndex, hasHeaderRow, hasNext, next, registerCommentCallBack, remove, setHasHeaderRow, setMinimumColumnCount, unregisterCommentCallBack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexRowFilter

public IndexRowFilter(TableReader reader,
                      int[] validRowIndices)
Constructor.

Parameters:
reader - underlying table reader
validRowIndices - all row indices that are valid for delivering
Method Detail

isValidRow

protected boolean isValidRow(java.lang.Object[] row)
Filters rows according to raw row index.

Specified by:
isValidRow in class AbstractRowFilter
Parameters:
row - row to be checked
Returns:
whether row is a valid row
See Also:
AbstractRowFilter.isValidRow(java.lang.Object[])

isMoreRowsExpected

protected boolean isMoreRowsExpected()
This method returns false when all valid rows were delivered.

Overrides:
isMoreRowsExpected in class AbstractRowFilter
Returns:
true if another valid row can be expected
See Also:
AbstractRowFilter.isMoreRowsExpected()

open

public void open()
Description copied from class: AbstractRowFilter
Opens this reader.

Specified by:
open in interface TableReader
Overrides:
open in class AbstractRowFilter
See Also:
AbstractRowFilter.open()

reset

public void reset()
Description copied from class: AbstractRowFilter
Resets the reader.

Specified by:
reset in interface TableReader
Overrides:
reset in class AbstractRowFilter
See Also:
AbstractRowFilter.reset()

Copyright © 2008-2011 Ralph Schuster. All Rights Reserved.

Copyright © 2008-2011 Ralph Schuster. All Rights Reserved.