org.openrdf.elmo.sesame.iterators
Class ConvertingIterator<S,E>

java.lang.Object
  extended by org.openrdf.elmo.sesame.iterators.ConvertingIterator<S,E>
Type Parameters:
S -
E -
All Implemented Interfaces:
Closeable, Iterator<E>

public abstract class ConvertingIterator<S,E>
extends Object
implements Iterator<E>, Closeable

Converts the delegate iterator into the result type.

Author:
James Leigh

Constructor Summary
ConvertingIterator(Iterator<S> delegate)
           
 
Method Summary
 void close()
           
protected abstract  E convert(S element)
           
 boolean hasNext()
           
 E next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvertingIterator

public ConvertingIterator(Iterator<S> delegate)
Method Detail

hasNext

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

next

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

remove

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

close

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

convert

protected abstract E convert(S element)


Copyright © 2004-2007. All Rights Reserved.