org.archive.wayback.util
Class AdaptedIterator<S,T>

java.lang.Object
  extended by org.archive.wayback.util.AdaptedIterator<S,T>
Type Parameters:
S -
T -
All Implemented Interfaces:
Closeable, Iterator<T>, CloseableIterator<T>

public class AdaptedIterator<S,T>
extends Object
implements CloseableIterator<T>

Iterator that transforms objects of one type to another.

Version:
$Date: 2010-09-29 05:28:38 +0700 (Wed, 29 Sep 2010) $, $Revision: 3262 $
Author:
brad

Field Summary
protected  Adapter<S,T> adapter
           
protected  Iterator<S> itr
           
 
Constructor Summary
AdaptedIterator(Iterator<S> itr, Adapter<S,T> adapter)
           
 
Method Summary
 void close()
           
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

itr

protected Iterator<S> itr

adapter

protected Adapter<S,T> adapter
Constructor Detail

AdaptedIterator

public AdaptedIterator(Iterator<S> itr,
                       Adapter<S,T> adapter)
Parameters:
itr -
adapter -
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<T>

next

public T next()
Specified by:
next in interface Iterator<T>

remove

public void remove()
Specified by:
remove in interface Iterator<T>

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2005-2011 Internet Archive. All Rights Reserved.