Class TransformIterator
java.lang.Object
org.apache.commons.collections.iterators.TransformIterator
- All Implemented Interfaces:
Iterator
Deprecated.
Apache Commons Collections version 3.x is being deprecated from AEMaaCS. The upgraded version 4.4 of Commons Collections is already included as replacement. Customers are advised to upgrade to this version of the library. Please note: the package name was changed to org.apache.commons.collections4. Further note that there are AEM APIs currently exposing the old collections classes; these will be updated in upcoming releases.
Decorates an iterator such that each element returned is transformed.
- Since:
- Commons Collections 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Constructs a newTransformIterator
that will not function until thesetIterator
method is invoked.TransformIterator
(Iterator iterator) Deprecated.Constructs a newTransformIterator
that won't transform elements from the given iterator.TransformIterator
(Iterator iterator, Transformer transformer) Deprecated.Constructs a newTransformIterator
that will use the given iterator and transformer. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Gets the iterator this iterator is using.Deprecated.Gets the transformer this iterator is using.boolean
hasNext()
Deprecated.next()
Deprecated.Gets the next object from the iteration, transforming it using the current transformer.void
remove()
Deprecated.void
setIterator
(Iterator iterator) Deprecated.Sets the iterator for this iterator to use.void
setTransformer
(Transformer transformer) Deprecated.Sets the transformer this the iterator to use.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
TransformIterator
public TransformIterator()Deprecated.Constructs a newTransformIterator
that will not function until thesetIterator
method is invoked. -
TransformIterator
Deprecated.Constructs a newTransformIterator
that won't transform elements from the given iterator.- Parameters:
iterator
- the iterator to use
-
TransformIterator
Deprecated.Constructs a newTransformIterator
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 usetransformer
- the transformer to use
-
-
Method Details
-
hasNext
public boolean hasNext()Deprecated. -
next
Deprecated.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.- Specified by:
next
in interfaceIterator
- Returns:
- the next object
- Throws:
NoSuchElementException
- if there are no more elements
-
remove
public void remove()Deprecated. -
getIterator
Deprecated.Gets the iterator this iterator is using.- Returns:
- the iterator.
-
setIterator
Deprecated.Sets the iterator for this iterator to use. If iteration has started, this effectively resets the iterator.- Parameters:
iterator
- the iterator to use
-
getTransformer
Deprecated.Gets the transformer this iterator is using.- Returns:
- the transformer.
-
setTransformer
Deprecated.Sets the transformer this the iterator to use. A null transformer is a no-op transformer.- Parameters:
transformer
- the transformer to use
-