org.jjoost.collections.iters
Class HeadIterator<E>

java.lang.Object
  extended by org.jjoost.collections.iters.HeadIterator<E>
All Implemented Interfaces:
java.util.Iterator<E>
Direct Known Subclasses:
HeadClosableIterator

public class HeadIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>


Constructor Summary
HeadIterator(java.util.Iterator<E> iterator, int take)
           
 
Method Summary
 int count()
          returns the number of items we have returned so far for this iterator; useful to determine how many items were actually used from the underlying iterator.
 boolean hasNext()
           
 E next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeadIterator

public HeadIterator(java.util.Iterator<E> iterator,
                    int take)
Method Detail

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>

count

public int count()
returns the number of items we have returned so far for this iterator; useful to determine how many items were actually used from the underlying iterator.

Returns: