xxl.visual
Class VisualIterator

java.lang.Object
  |
  +--xxl.visual.VisualIterator
Direct Known Subclasses:
VisualFileInputIterator, VisualPeekIterator

public class VisualIterator
extends java.lang.Object
implements java.util.Iterator


Inner Class Summary
static interface VisualIterator.IteratorFunction
           
 
Field Summary
protected  VisualIterator[] children
           
protected  VisualIterator inputOf
           
protected  java.util.Iterator iterator
           
protected  VisualIterator.IteratorFunction newIterator
           
protected  java.lang.Object[] parameters
           
 
Constructor Summary
VisualIterator(VisualIterator.IteratorFunction newIterator)
           
VisualIterator(VisualIterator.IteratorFunction newIterator, int noOfChildren)
          Creates a new VisualIterator.
 
Method Summary
 void addInput(VisualIterator input, int index)
           
 java.lang.Object[] getParameters()
          Returns parameters.
 boolean hasNext()
          Returns true if the iteration has more elements.
 java.lang.Object next()
          Returns the next element in the iteration.
 void open()
          Calls open on all input-Iterators and creates the Iterator with the IteratorFunction.
 void remove()
          Removes from the underlying collection the last element returned by the iterator (optional operation).
 void removeInput(int index)
           
 void setParameters(java.lang.Object[] parameters)
          Sets parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

newIterator

protected VisualIterator.IteratorFunction newIterator

iterator

protected java.util.Iterator iterator

parameters

protected java.lang.Object[] parameters

inputOf

protected VisualIterator inputOf

children

protected VisualIterator[] children
Constructor Detail

VisualIterator

public VisualIterator(VisualIterator.IteratorFunction newIterator,
                      int noOfChildren)
Creates a new VisualIterator.

VisualIterator

public VisualIterator(VisualIterator.IteratorFunction newIterator)
Method Detail

addInput

public void addInput(VisualIterator input,
                     int index)

removeInput

public void removeInput(int index)

setParameters

public void setParameters(java.lang.Object[] parameters)
Sets parameters.

getParameters

public java.lang.Object[] getParameters()
Returns parameters.

open

public void open()
Calls open on all input-Iterators and creates the Iterator with the IteratorFunction.

hasNext

public boolean hasNext()
Returns true if the iteration has more elements.
Specified by:
hasNext in interface java.util.Iterator
Returns:
true if the iterator has more elements

next

public java.lang.Object next()
                      throws java.util.NoSuchElementException
Returns the next element in the iteration.
Specified by:
next in interface java.util.Iterator
Returns:
the next element in the iteration
Throws:
java.util.NoSuchElementException - iteration has no more elements.

remove

public void remove()
            throws java.lang.IllegalStateException,
                   java.lang.UnsupportedOperationException
Removes from the underlying collection the last element returned by the iterator (optional operation).
Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.IllegalStateException - if the next method has not yet been called, or the remove method has already been called after the last call to the next method.
java.lang.UnsupportedOperationException - if the remove operation is not supported by this Iterator.