xxl.cursors
Class Minimator

java.lang.Object
  |
  +--xxl.cursors.Aggregator
        |
        +--xxl.cursors.Minimator

public class Minimator
extends Aggregator

The Minimator computes the minimal object for a given input-Iterator.


Field Summary
protected  Function mapping
           
 
Fields inherited from class xxl.cursors.Aggregator
aggregate, cursor, function, initialized
 
Constructor Summary
Minimator(java.util.Iterator iterator)
          Creates a new Minimator.
Minimator(java.util.Iterator iterator, java.util.Comparator comparator)
          Creates a new Minimator.
Minimator(java.util.Iterator iterator, Function mapping)
          Creates a new Minimator.
Minimator(java.util.Iterator iterator, Function mapping, java.util.Comparator comparator)
          Creates a new Minimator.
 
Method Summary
 java.lang.Object next()
          Returns the next element in the iteration.
 java.lang.Object peek()
          Shows the next element in the iteration without removing it.
 
Methods inherited from class xxl.cursors.Aggregator
close, hasNext, last, remove, reset, supportsPeek, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapping

protected Function mapping
Constructor Detail

Minimator

public Minimator(java.util.Iterator iterator,
                 Function mapping,
                 java.util.Comparator comparator)
Creates a new Minimator.
Parameters:
iterator - the input-Iterator
mapping - the Function used to map an input-Object to a certain value
comparator - the Comparator used to determine whether the actual Object is smaller than the actual minima

Minimator

public Minimator(java.util.Iterator iterator)
Creates a new Minimator.
Parameters:
iterator - the input-Iterator

Minimator

public Minimator(java.util.Iterator iterator,
                 Function mapping)
Creates a new Minimator.
Parameters:
iterator - the input-Iterator
mapping - the Function used to map an input-Object to a certain value

Minimator

public Minimator(java.util.Iterator iterator,
                 java.util.Comparator comparator)
Creates a new Minimator.
Parameters:
iterator - the input-Iterator
comparator - the Comparator used to determine whether the actual Object is smaller than the actual minima
Method Detail

next

public java.lang.Object next()
                      throws java.util.NoSuchElementException
Returns the next element in the iteration.
Returns:
the next element in the iteration.
Throws:
java.util.NoSuchElementException - iteration has no more elements.
Overrides:
next in class Aggregator

peek

public java.lang.Object peek()
                      throws java.util.NoSuchElementException,
                             java.lang.UnsupportedOperationException
Shows the next element in the iteration without removing it.
Returns:
the next element in the iteration.
Throws:
java.util.NoSuchElementException - iteration has no more elements.
java.lang.UnsupportedOperationException - if the peek operation is not supported by this PeekIterator.
Overrides:
peek in class Aggregator