com.neeve.lang
Class XCollectionIterator<T>

java.lang.Object
  extended by com.neeve.lang.XCollectionIterator<T>
All Implemented Interfaces:
XIterator<T>, Iterator<T>

public final class XCollectionIterator<T>
extends Object
implements XIterator<T>

This class represents an iterator over a XCollection. Iterations are thread-safe if the collections records are not removed or inserted at arbitrary position (appending/prepending is fine).

This class was based on collections code from http://javolution.org, but modified for use outside of realtime jvms.


Method Summary
 boolean hasNext()
           
 T next()
           
 void remove()
           
 XCollectionIterator<T> toFirst()
          Resets the iterator to the first element.
static
<T> XCollectionIterator<T>
valueOf(XCollection<T> collection)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

valueOf

public static <T> XCollectionIterator<T> valueOf(XCollection<T> collection)

toFirst

public XCollectionIterator<T> toFirst()
Description copied from interface: XIterator
Resets the iterator to the first element.

Specified by:
toFirst in interface XIterator<T>

hasNext

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

next

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

remove

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


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.