org.openjena.atlas.iterator
Class PeekIterator<T>

java.lang.Object
  extended by org.openjena.atlas.iterator.PeekIterator<T>
All Implemented Interfaces:
java.util.Iterator<T>

public class PeekIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>

PeekIterator - is one slot ahead from the wrapped iterator


Constructor Summary
PeekIterator(java.util.Iterator<T> iter)
           
 
Method Summary
static
<T> PeekIterator<T>
create(java.util.Iterator<T> iter)
           
static
<T> PeekIterator<T>
create(PeekIterator<T> iter)
           
 boolean hasNext()
           
 T next()
           
 T peek()
          Peek the next element or throw NoSuchElementException
 T peekOrNull()
          Peek the next element or return null
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeekIterator

public PeekIterator(java.util.Iterator<T> iter)
Method Detail

create

public static <T> PeekIterator<T> create(PeekIterator<T> iter)

create

public static <T> PeekIterator<T> create(java.util.Iterator<T> iter)

hasNext

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

peek

public T peek()
Peek the next element or throw NoSuchElementException


peekOrNull

public T peekOrNull()
Peek the next element or return null


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>


Copyright ? 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP Copyright ? 2010 Talis Systems Ltd. Copyright ? 2010, 2011 Epimorphics Ltd.