org.knime.base.node.mine.bfn
Class BasisFunctionIterator

java.lang.Object
  extended by org.knime.core.data.RowIterator
      extended by org.knime.base.node.mine.bfn.BasisFunctionIterator
All Implemented Interfaces:
Iterator<DataRow>

public final class BasisFunctionIterator
extends RowIterator

Iterator over all BasisFunctionLearnerRows within the model. Supports to skip certain classes.

Author:
Thomas Gabriel, University of Konstanz

Constructor Summary
BasisFunctionIterator(BasisFunctionLearnerTable table)
          Creates a new basisfunction iterator.
 
Method Summary
 boolean hasNext()
          Checks if the iterator already reached the end of the iteration.
 DataRow next()
          Returns the next DataRow.
 BasisFunctionLearnerRow nextBasisFunction()
          Returns the next row in the iteration.
 void skipClass()
          Skips the current class, next() will then return the first basis function of the next class.
 
Methods inherited from class org.knime.core.data.RowIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasisFunctionIterator

public BasisFunctionIterator(BasisFunctionLearnerTable table)
Creates a new basisfunction iterator. Does not perform error checking.

Parameters:
table - the underlying learner table
Throws:
NullPointerException - if the table is null
Method Detail

hasNext

public boolean hasNext()
Checks if the iterator already reached the end of the iteration. Here, we need to check to conditions. One, if the current iterator is at end, and, second, if the all classes have been processed.

Specified by:
hasNext in interface Iterator<DataRow>
Specified by:
hasNext in class RowIterator
Returns:
true if the end has been reached otherwise.
See Also:
RowIterator.next()

nextBasisFunction

public BasisFunctionLearnerRow nextBasisFunction()
Returns the next row in the iteration. If the current iteration is at end, the iteration will be start over at the next class, otherwise the basisfunction index is increased.

Returns:
the next row in the iteration
Throws:
NoSuchElementException - if there are no more rows

next

public DataRow next()
Returns the next DataRow.

Specified by:
next in interface Iterator<DataRow>
Specified by:
next in class RowIterator
Returns:
the next row in the DataTable

skipClass

public void skipClass()
Skips the current class, next() will then return the first basis function of the next class. If the current class is the last, the basisfunction index is set to the last element +1 and hasNext() will return false.



Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.