| java.lang.Object org.apache.commons.collections.iterators.TransformIterator
TransformIterator | public class TransformIterator implements Iterator(Code) | | Decorates an iterator such that each element returned is transformed.
since: Commons Collections 1.0 version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $ author: James Strachan author: Stephen Colebourne |
TransformIterator | public TransformIterator(Iterator iterator)(Code) | | Constructs a new TransformIterator that won't transform
elements from the given iterator.
Parameters: iterator - the iterator to use |
TransformIterator | public TransformIterator(Iterator iterator, Transformer transformer)(Code) | | Constructs a new TransformIterator that will use the
given iterator and transformer. If the given transformer is null,
then objects will not be transformed.
Parameters: iterator - the iterator to use Parameters: transformer - the transformer to use |
getIterator | public Iterator getIterator()(Code) | | Gets the iterator this iterator is using.
the iterator. |
getTransformer | public Transformer getTransformer()(Code) | | Gets the transformer this iterator is using.
the transformer. |
hasNext | public boolean hasNext()(Code) | | |
next | public Object next()(Code) | | Gets the next object from the iteration, transforming it using the
current transformer. If the transformer is null, no transformation
occurs and the object from the iterator is returned directly.
the next object throws: java.util.NoSuchElementException - if there are no more elements |
remove | public void remove()(Code) | | |
setIterator | public void setIterator(Iterator iterator)(Code) | | Sets the iterator for this iterator to use.
If iteration has started, this effectively resets the iterator.
Parameters: iterator - the iterator to use |
setTransformer | public void setTransformer(Transformer transformer)(Code) | | Sets the transformer this the iterator to use.
A null transformer is a no-op transformer.
Parameters: transformer - the transformer to use |
transform | protected Object transform(Object source)(Code) | | Transforms the given object using the transformer.
If the transformer is null, the original object is returned as-is.
Parameters: source - the object to transform the transformed object |
|
|