adams.data.spreadsheet.cellfinder
Class AbstractMetaIterator

java.lang.Object
  extended by adams.data.spreadsheet.cellfinder.AbstractMetaIterator
All Implemented Interfaces:
Iterator<CellLocation>
Direct Known Subclasses:
CorrespondingColumn.CorrespondingColumnIterator

public abstract class AbstractMetaIterator
extends Object
implements Iterator<CellLocation>

A meta-iterator that wraps around a base iterator.

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

Field Summary
protected  Iterator<CellLocation> m_Base
          the base iterator to use.
 
Constructor Summary
AbstractMetaIterator(Iterator<CellLocation> base)
          Initializes the iterator.
 
Method Summary
 boolean hasNext()
          Returns whether another cell location is available.
 CellLocation next()
          Returns the next cell location.
protected abstract  CellLocation process(CellLocation location)
          Processes the cell location.
 void remove()
          Removes from the underlying collection the last element returned by the iterator (optional operation), if the base iterator supports this.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Base

protected Iterator<CellLocation> m_Base
the base iterator to use.

Constructor Detail

AbstractMetaIterator

public AbstractMetaIterator(Iterator<CellLocation> base)
Initializes the iterator.

Parameters:
base - the base iterator to use
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

process

protected abstract CellLocation process(CellLocation location)
Processes the cell location.

Parameters:
location - the location to process
Returns:
the processed location

next

public CellLocation next()
Returns the next cell location.

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

remove

public void remove()
Removes from the underlying collection the last element returned by the iterator (optional operation), if the base iterator supports this.

Specified by:
remove in interface Iterator<CellLocation>


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