com.neeve.util
Class UtlLinkedHashMap.FastIterator
java.lang.Object
com.neeve.util.UtlLinkedHashMap.FastIterator
- All Implemented Interfaces:
- Iterator<Map.Entry<K,V>>, ListIterator<Map.Entry<K,V>>
- Enclosing class:
- UtlLinkedHashMap<K,V>
public final class UtlLinkedHashMap.FastIterator
- extends Object
- implements ListIterator<Map.Entry<K,V>>
This inner class represents a reusable list iterator over
UtlLinkedHashMap
entries. This iterator is bi-directional and can be
directly moved to the first
or last
entry. For example:
for (FastIterator i=map.fastIterator().toFirst(); i.hasNext();) {
Entry entry = i.nextEntry();
...
}
setting
or adding
new entries is not
supported.
UtlLinkedHashMap.FastIterator
public UtlLinkedHashMap.FastIterator()
toFirst
public UtlLinkedHashMap.FastIterator toFirst()
- Resets the iterator to the beginning.
- Returns:
- The FastIterator for invocation chaining.
toLast
public UtlLinkedHashMap.FastIterator toLast()
- Resets the iterator to the last element.
- Returns:
- The FastIterator for invocation chaining.
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<Map.Entry<K,V>>
- Specified by:
hasNext
in interface ListIterator<Map.Entry<K,V>>
nextEntry
public Map.Entry<K,V> nextEntry()
next
public Map.Entry<K,V> next()
- Specified by:
next
in interface Iterator<Map.Entry<K,V>>
- Specified by:
next
in interface ListIterator<Map.Entry<K,V>>
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPrevious
in interface ListIterator<Map.Entry<K,V>>
previousEntry
public Map.Entry<K,V> previousEntry()
previous
public Map.Entry<K,V> previous()
- Specified by:
previous
in interface ListIterator<Map.Entry<K,V>>
nextIndex
public int nextIndex()
- Specified by:
nextIndex
in interface ListIterator<Map.Entry<K,V>>
previousIndex
public int previousIndex()
- Specified by:
previousIndex
in interface ListIterator<Map.Entry<K,V>>
remove
public void remove()
- Specified by:
remove
in interface Iterator<Map.Entry<K,V>>
- Specified by:
remove
in interface ListIterator<Map.Entry<K,V>>
set
public void set(Map.Entry<K,V> o)
- Specified by:
set
in interface ListIterator<Map.Entry<K,V>>
add
public void add(Map.Entry<K,V> o)
- Specified by:
add
in interface ListIterator<Map.Entry<K,V>>
Copyright © 2016 Neeve Research, LLC. All Rights Reserved.