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.
|
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 java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
mapping
protected Function mapping
Minimator
public Minimator(java.util.Iterator iterator,
Function mapping,
java.util.Comparator comparator)
- Creates a new Minimator.
- Parameters:
iterator - the input-Iteratormapping - the Function used to map an input-Object to a certain valuecomparator - 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-Iteratormapping - 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-Iteratorcomparator - the Comparator used to determine whether the actual Object is smaller than the actual minima
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