javatools.datatypes
Class PeekIterator.SimplePeekIterator<T>

java.lang.Object
  extended by javatools.datatypes.PeekIterator<T>
      extended by javatools.datatypes.PeekIterator.SimplePeekIterator<T>
All Implemented Interfaces:
java.io.Closeable, java.lang.Iterable<T>, java.util.Iterator<T>
Enclosing class:
PeekIterator<T>

public static class PeekIterator.SimplePeekIterator<T>
extends PeekIterator<T>

A PeekIterator that can iterate over another iterator or over a list of elements


Nested Class Summary
 
Nested classes/interfaces inherited from class javatools.datatypes.PeekIterator
PeekIterator.ElementaryPeekIterator<T>, PeekIterator.SimplePeekIterator<T>
 
Field Summary
 java.util.Iterator<T> iterator
          Wrapped iterator
 
Fields inherited from class javatools.datatypes.PeekIterator
closed, initialized, next
 
Constructor Summary
PeekIterator.SimplePeekIterator(java.lang.Iterable<T> i)
          Constructs a PeekIterator from an Iteratable (e.g.
PeekIterator.SimplePeekIterator(java.util.Iterator<T> i)
          Constructs a PeekIterator from another Iterator
PeekIterator.SimplePeekIterator(T... elements)
          Constructs a PeekIterator for a given list of elements
PeekIterator.SimplePeekIterator(T element)
          Constructs a PeekIterator for a given list of elements
 
Method Summary
 void remove()
          Removes the current element, if supported by the underlying iterator
 java.lang.String toString()
           
 
Methods inherited from class javatools.datatypes.PeekIterator
asList, asList, asSet, asSet, asSet, close, emptyIterator, hasNext, iterator, list, list, main, next, nextOrNull, numElements, numElements, peek, toString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

iterator

public java.util.Iterator<T> iterator
Wrapped iterator

Constructor Detail

PeekIterator.SimplePeekIterator

public PeekIterator.SimplePeekIterator(java.util.Iterator<T> i)
Constructs a PeekIterator from another Iterator


PeekIterator.SimplePeekIterator

public PeekIterator.SimplePeekIterator(java.lang.Iterable<T> i)
Constructs a PeekIterator from an Iteratable (e.g. a list)


PeekIterator.SimplePeekIterator

public PeekIterator.SimplePeekIterator(T... elements)
Constructs a PeekIterator for a given list of elements


PeekIterator.SimplePeekIterator

public PeekIterator.SimplePeekIterator(T element)
Constructs a PeekIterator for a given list of elements

Method Detail

remove

public void remove()
Removes the current element, if supported by the underlying iterator

Specified by:
remove in interface java.util.Iterator<T>
Overrides:
remove in class PeekIterator<T>

toString

public java.lang.String toString()
Overrides:
toString in class PeekIterator<T>