org.millscript.commons.util.list
Class ELinkedList.ELinkedListIterator<V>

java.lang.Object
  extended by org.millscript.commons.util.iterator.AbstractMapIterator<java.lang.Integer,V>
      extended by org.millscript.commons.util.iterator.AbstractListIterator<V>
          extended by org.millscript.commons.util.list.ELinkedList.ELinkedListIterator<V>
All Implemented Interfaces:
ListIterator<V>, MapIterator<java.lang.Integer,V>
Direct Known Subclasses:
ELinkedList.SharedLinkedListIterator
Enclosing class:
ELinkedList<V>

public static class ELinkedList.ELinkedListIterator<V>
extends AbstractListIterator<V>

This class provides a map interator implementation which iterates over this values in the specified linked list.


Field Summary
 
Fields inherited from class org.millscript.commons.util.iterator.AbstractListIterator
position
 
Constructor Summary
ELinkedList.ELinkedListIterator(ELinkedList<V> list)
          Constructs a new singleton map iterator to iterate over the values in the specified linked list.
 
Method Summary
protected  void advance()
          Advances this iterator to its next point.
protected  V getValue()
          Returns the value for the current mapping in the iteration.
 boolean hasNext()
          Returns true if there are more values available in this iteration and false otherwise.
protected  boolean outOfBounds()
          Returns true if this iterator is outside its bounds(before the first element or beyond the last) and false otherwise.
 
Methods inherited from class org.millscript.commons.util.iterator.AbstractListIterator
currentMaplet, getKey, getMaplet, nextMaplet
 
Methods inherited from class org.millscript.commons.util.iterator.AbstractMapIterator
currentKey, currentValue, nextKey, nextValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.millscript.commons.util.MapIterator
currentKey, currentValue, nextKey, nextValue
 

Constructor Detail

ELinkedList.ELinkedListIterator

public ELinkedList.ELinkedListIterator(ELinkedList<V> list)
Constructs a new singleton map iterator to iterate over the values in the specified linked list.

Parameters:
obj - the linked list whose values to iterate over
Method Detail

advance

protected void advance()
Description copied from class: AbstractMapIterator
Advances this iterator to its next point. This method allows a common implementation of the next* methods, making it a little bit easier to implement the map iterator interface.

Overrides:
advance in class AbstractListIterator<V>
See Also:
AbstractMapIterator.advance()

getValue

protected V getValue()
Description copied from class: AbstractMapIterator
Returns the value for the current mapping in the iteration. This method must be implemented by any concrete implementation and should not need to perform bounds checking.

Specified by:
getValue in class AbstractMapIterator<java.lang.Integer,V>
Returns:
the value for the current mapping
See Also:
AbstractMapIterator.getValue()

hasNext

public boolean hasNext()
Description copied from interface: MapIterator
Returns true if there are more values available in this iteration and false otherwise.

Returns:
true if there are more values in this iteration and false otherwise
See Also:
MapIterator.hasNext()

outOfBounds

protected boolean outOfBounds()
Description copied from class: AbstractMapIterator
Returns true if this iterator is outside its bounds(before the first element or beyond the last) and false otherwise.

Specified by:
outOfBounds in class AbstractMapIterator<java.lang.Integer,V>
Returns:
true if this iterator is outside its bounds and false otherwise
See Also:
AbstractMapIterator.outOfBounds()


Copyright © 2005-2007 Open World Ltd. All Rights Reserved.