Class TreeBidiMap.ViewIterator
java.lang.Object
org.apache.commons.collections.bidimap.TreeBidiMap.ViewIterator
- All Implemented Interfaces:
Iterator,OrderedIterator
- Direct Known Subclasses:
TreeBidiMap.ViewMapIterator
- Enclosing class:
TreeBidiMap
An iterator over the map.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intWhether to return KEY, VALUE, MAPENTRY or INVERSEMAPENTRY data.private intThe modification count.protected TreeBidiMap.NodeThe last node returned by the iterator.protected final TreeBidiMapThe parent map.protected TreeBidiMap.NodeThe next node to be returned by the iterator.protected final intWhether to return KEY or VALUE order.protected TreeBidiMap.NodeThe previous node in the sequence returned by the iterator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectGets the data value for the lastReturnedNode field.final booleanhasNext()booleanChecks to see if there is a previous element that can be iterated to.final Objectnext()previous()Gets the previous element from the collection.final voidremove()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
main
The parent map. -
orderType
protected final int orderTypeWhether to return KEY or VALUE order. -
dataType
protected final int dataTypeWhether to return KEY, VALUE, MAPENTRY or INVERSEMAPENTRY data. -
lastReturnedNode
The last node returned by the iterator. -
nextNode
The next node to be returned by the iterator. -
previousNode
The previous node in the sequence returned by the iterator. -
expectedModifications
private int expectedModificationsThe modification count.
-
-
Constructor Details
-
ViewIterator
ViewIterator(TreeBidiMap main, int orderType, int dataType) Constructor.- Parameters:
main- the main maporderType- the KEY or VALUE int for the orderdataType- the KEY, VALUE, MAPENTRY or INVERSEMAPENTRY int
-
-
Method Details
-
hasNext
public final boolean hasNext() -
next
-
hasPrevious
public boolean hasPrevious()Description copied from interface:OrderedIteratorChecks to see if there is a previous element that can be iterated to.- Specified by:
hasPreviousin interfaceOrderedIterator- Returns:
trueif the iterator has a previous element
-
previous
Description copied from interface:OrderedIteratorGets the previous element from the collection.- Specified by:
previousin interfaceOrderedIterator- Returns:
- the previous element in the iteration
-
doGetData
Gets the data value for the lastReturnedNode field.- Returns:
- the data value
-
remove
public final void remove()
-