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:
java.io.Closeable, java.util.Iterator<T>, CloseableIterator<T>

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

Iterator that transforms objects of one type to another.

Version:
$Date: 2007-07-24 17:34:39 -0700 (Tue, 24 Jul 2007) $, $Revision: 1872 $
Author:
brad

Field Summary
protected  Adapter<S,T> adapter
           
protected  java.util.Iterator<S> itr
           
 
Constructor Summary
AdaptedIterator(java.util.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 java.util.Iterator<S> itr

adapter

protected Adapter<S,T> adapter
Constructor Detail

AdaptedIterator

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

hasNext

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

next

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

remove

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

close

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


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