Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jdaemon.util.iterator
Class FunctionIterator  view FunctionIterator download FunctionIterator.java

java.lang.Object
  extended byorg.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:

Field Summary
private  java.util.Iterator iter
          Iterator to which function is applied
 
Constructor Summary
FunctionIterator(java.util.Iterator iter)
          Creates new FunctionIterator
 
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
 

Field Detail

iter

private java.util.Iterator iter
Iterator to which function is applied

Constructor Detail

FunctionIterator

public FunctionIterator(java.util.Iterator iter)
Creates new FunctionIterator

Method Detail

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