S
- the source object type served by the wrapped iteratorT
- the object type served by the resource iteratorpublic abstract class GenericResourceIteratorAdapter<S,T> extends Object implements ResourceIterator<T>
ResourceIterator
adapter for a normal iterator that can perform a
conversion from the iterator elements to a target element type.Constructor and Description |
---|
GenericResourceIteratorAdapter(Iterator<S> iterator)
Create a
ResourceIterator adapter for the given iterator. |
public GenericResourceIteratorAdapter(Iterator<S> iterator)
ResourceIterator
adapter for the given iterator.iterator
- the iterator to adaptpublic boolean hasNext()
hasNext
in interface Iterator<T>
Iterator.hasNext()
public T next()
next
in interface Iterator<T>
Iterator.next()
protected abstract T convert(S next)
next()
.next
- the object to convertpublic void remove()
remove
in interface Iterator<T>
Iterator.remove()
public void close()
ResourceIterator
Iterator.next()
may not
be called.close
in interface ResourceIterator<T>
close
in interface Closeable
close
in interface AutoCloseable
ResourceIterator.close()
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a