|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.commons.util.iterator.AbstractMapIterator<K,V>
public abstract class AbstractMapIterator<K,V>
The class provides a skeletal implementation of the map iterator interface, to help with custom implementations.
All you need to do is provide an implmentation for the advance(), getKey(), getValue() and outOfBounds() methods.
| Constructor Summary | |
|---|---|
AbstractMapIterator()
|
|
| Method Summary | |
|---|---|
protected abstract void |
advance()
Advances this iterator to its next point. |
K |
currentKey()
Returns the key for the current mapping in the iteration. |
Maplet<K,V> |
currentMaplet()
Returns the current mapping in the iteration. |
V |
currentValue()
Returns the value for the current mapping in the iteration. |
protected abstract K |
getKey()
Returns the key for the current mapping in the iteration. |
protected Maplet<K,V> |
getMaplet()
Returns the current mapping in the iteration. |
protected abstract V |
getValue()
Returns the value for the current mapping in the iteration. |
K |
nextKey()
Returns the key for the next mapping in the iteration. |
Maplet<K,V> |
nextMaplet()
Returns the next mapping in the iteration. |
V |
nextValue()
Returns the value for the next mapping in the iteration. |
protected abstract 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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.millscript.commons.util.MapIterator |
|---|
hasNext |
| Constructor Detail |
|---|
public AbstractMapIterator()
| Method Detail |
|---|
protected abstract void advance()
protected abstract boolean outOfBounds()
true if this iterator is outside its bounds(before
the first element or beyond the last) and false otherwise.
true if this iterator is outside its bounds and
false otherwiseprotected abstract K getKey()
protected Maplet<K,V> getMaplet()
protected abstract V getValue()
public K currentKey()
MapIterator
currentKey in interface MapIterator<K,V>MapIterator.currentKey()public Maplet<K,V> currentMaplet()
MapIterator
currentMaplet in interface MapIterator<K,V>MapIterator.currentMaplet()public V currentValue()
MapIterator
currentValue in interface MapIterator<K,V>MapIterator.currentValue()public K nextKey()
MapIterator
nextKey in interface MapIterator<K,V>MapIterator.nextKey()public Maplet<K,V> nextMaplet()
MapIterator
nextMaplet in interface MapIterator<K,V>MapIterator.nextMaplet()public V nextValue()
MapIterator
nextValue in interface MapIterator<K,V>MapIterator.nextValue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||