org.openanzo.utils
Class CloseableWrapper<E>

java.lang.Object
  extended by org.openanzo.utils.CloseableWrapper<E>
Type Parameters:
E - Type of objects being iterated
All Implemented Interfaces:
info.aduna.collections.iterators.CloseableIterator<E>, java.io.Closeable, java.util.Iterator<E>

public class CloseableWrapper<E>
extends java.lang.Object
implements info.aduna.collections.iterators.CloseableIterator<E>

Wrap a plain Iterator with a CloseableIterator.

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
CloseableWrapper(java.util.Iterator<E> base)
          Create new CloseableWrapper for base iterator
 
Method Summary
 void close()
           
 boolean hasNext()
           
 E next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloseableWrapper

public CloseableWrapper(java.util.Iterator<E> base)
Create new CloseableWrapper for base iterator

Parameters:
base - Iterator to wrap
Method Detail

close

public void close()
Specified by:
close in interface info.aduna.collections.iterators.CloseableIterator<E>
Specified by:
close in interface java.io.Closeable

hasNext

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

next

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

remove

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


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.