java.lang.Object
org.jdaemon.util.iterator.FunctionIterator
- All Implemented Interfaces:
- java.util.Iterator
- Direct Known Subclasses:
- MapEntryConverter
- public abstract class FunctionIterator
- extends java.lang.Object
- implements java.util.Iterator
Iterator which is the result of applying some function to all elements of some
other itereration
- Version:
|
Method Summary |
abstract java.lang.Object |
function(java.lang.Object obj)
Function that will be applied to each element of iter |
boolean |
hasNext()
True if more elements exist in this itereration |
java.lang.Object |
next()
Returns the result of applying function to an element of iter |
void |
remove()
Remove from the underlying collection the last element returned by next
(optional operation). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
iter
private java.util.Iterator iter
- Iterator to which function is applied
FunctionIterator
public FunctionIterator(java.util.Iterator iter)
- Creates new FunctionIterator
hasNext
public boolean hasNext()
- True if more elements exist in this itereration
- Specified by:
hasNext in interface java.util.Iterator
next
public java.lang.Object next()
- Returns the result of applying function to an element of iter
- Specified by:
next in interface java.util.Iterator
remove
public void remove()
- Description copied from interface:
java.util.Iterator
- Remove from the underlying collection the last element returned by next
(optional operation). This method can be called only once after each
call to
next(). It does not affect what will be returned
by subsequent calls to next.
- Specified by:
remove in interface java.util.Iterator
function
public abstract java.lang.Object function(java.lang.Object obj)
- Function that will be applied to each element of iter