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 int
m_Column
the current column (index).protected int[]
m_Columns
the column indices.protected boolean
m_Finished
whether we finished searching.protected int[]
m_Next
the next location.protected int
m_Row
the current row (index).protected int[]
m_Rows
the row indices.protected SpreadSheet
m_Sheet
the spreadsheet to process.protected Row
m_SheetRow
the row to process.protected Cell.ContentType
m_Type
the 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 void
findNext()
Find the next location.boolean
hasNext()
Returns whether another cell location is available.CellLocation
next()
Returns the next cell location.void
remove()
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:
hasNext
in interfaceIterator<CellLocation>
- Returns:
- true if another is available
-
next
public CellLocation next()
Returns the next cell location.- Specified by:
next
in interfaceIterator<CellLocation>
- Returns:
- the cell location
-
remove
public void remove()
Not supported.- Specified by:
remove
in interfaceIterator<CellLocation>
-
-