org.archive.util.iterator
Class TransformingIteratorWrapper<Original,Transformed>
java.lang.Object
org.archive.util.iterator.LookaheadIterator<Transformed>
org.archive.util.iterator.TransformingIteratorWrapper<Original,Transformed>
- All Implemented Interfaces:
- java.util.Iterator<Transformed>
- Direct Known Subclasses:
- RegexpLineIterator, SeedFileIterator
public abstract class TransformingIteratorWrapper<Original,Transformed>
- extends LookaheadIterator<Transformed>
Superclass for Iterators which transform and/or filter results
from a wrapped Iterator. Because transform() has the option of
discarding an item from the inner Iterator (by returning null),
this is a kind of LookaheadIterator.
- Author:
- gojomo
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
inner
protected java.util.Iterator<Original> inner
TransformingIteratorWrapper
public TransformingIteratorWrapper()
lookahead
protected boolean lookahead()
- Description copied from class:
LookaheadIterator
- Caches the next item if available.
- Specified by:
lookahead
in class LookaheadIterator<Transformed>
- Returns:
- true if there was a next item to cache, false otherwise
noteExhausted
protected void noteExhausted()
- Any cleanup to occur when hasNext() is about to return false
transform
protected abstract Transformed transform(Original object)
- Parameters:
object
- Object to transform.
- Returns:
- Transfomed object.
Copyright © 2003-2011 Internet Archive. All Rights Reserved.