Class TypeRangeIterator
- java.lang.Object
-
- adams.data.spreadsheet.cellfinder.TypeRangeIterator
-
- All Implemented Interfaces:
Iterator<CellLocation>
public class TypeRangeIterator extends Object implements Iterator<CellLocation>
Iterates over a range of cells, looking for a type of cell.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_Columnthe current column (index).protected int[]m_Columnsthe column indices.protected booleanm_Finishedwhether we finished searching.protected int[]m_Nextthe next location.protected intm_Rowthe current row (index).protected int[]m_Rowsthe row indices.protected SpreadSheetm_Sheetthe spreadsheet to process.protected Rowm_SheetRowthe row to process.protected Cell.ContentTypem_Typethe cell type to look for.
-
Constructor Summary
Constructors Constructor Description TypeRangeIterator(Row sheetRow, Cell.ContentType type, int[] cols)Initializes the iterator.TypeRangeIterator(SpreadSheet sheet, Cell.ContentType type, int[] rows, int[] cols)Initializes the iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfindNext()Find the next location.booleanhasNext()Returns whether another cell location is available.CellLocationnext()Returns the next cell location.voidremove()Not supported.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
m_Sheet
protected SpreadSheet m_Sheet
the spreadsheet to process.
-
m_SheetRow
protected Row m_SheetRow
the row to process.
-
m_Type
protected Cell.ContentType m_Type
the cell type to look for.
-
m_Rows
protected int[] m_Rows
the row indices.
-
m_Columns
protected int[] m_Columns
the column indices.
-
m_Row
protected int m_Row
the current row (index).
-
m_Column
protected int m_Column
the current column (index).
-
m_Finished
protected boolean m_Finished
whether we finished searching.
-
m_Next
protected int[] m_Next
the next location.
-
-
Constructor Detail
-
TypeRangeIterator
public TypeRangeIterator(SpreadSheet sheet, Cell.ContentType type, int[] rows, int[] cols)
Initializes the iterator.- Parameters:
sheet- the sheet to usetype- the content typerows- the row indices of the rangecols- the column indices of the range
-
TypeRangeIterator
public TypeRangeIterator(Row sheetRow, Cell.ContentType type, int[] cols)
Initializes the iterator.- Parameters:
sheetRow- the row to usetype- the content typecols- the column indices of the range
-
-
Method Detail
-
findNext
protected void findNext()
Find the next location.
-
hasNext
public boolean hasNext()
Returns whether another cell location is available.- Specified by:
hasNextin interfaceIterator<CellLocation>- Returns:
- true if another is available
-
next
public CellLocation next()
Returns the next cell location.- Specified by:
nextin interfaceIterator<CellLocation>- Returns:
- the cell location
-
remove
public void remove()
Not supported.- Specified by:
removein interfaceIterator<CellLocation>
-
-