adams.data.spreadsheet.cellfinder
Class RangeIterator

java.lang.Object
  extended by adams.data.spreadsheet.cellfinder.RangeIterator
All Implemented Interfaces:
Iterator<CellLocation>

public class RangeIterator
extends Object
implements Iterator<CellLocation>

Iterates over a range of cells.

Version:
$Revision: 6606 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Field Summary
protected  int m_Column
          the current column (index).
protected  int[] m_Columns
          the column indices.
protected  int m_Row
          the current row (index).
protected  int[] m_Rows
          the row indices.
 
Constructor Summary
RangeIterator(int[] rows, int[] cols)
          Initializes the iterator.
 
Method Summary
 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
 

Field Detail

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).

Constructor Detail

RangeIterator

public RangeIterator(int[] rows,
                     int[] cols)
Initializes the iterator.

Parameters:
rows - the row indices of the range
cols - the column indices of the range
Method Detail

hasNext

public boolean hasNext()
Returns whether another cell location is available.

Specified by:
hasNext in interface Iterator<CellLocation>
Returns:
true if another is available

next

public CellLocation next()
Returns the next cell location.

Specified by:
next in interface Iterator<CellLocation>
Returns:
the cell location

remove

public void remove()
Not supported.

Specified by:
remove in interface Iterator<CellLocation>


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.