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 int
Whether to return KEY, VALUE, MAPENTRY or INVERSEMAPENTRY data.private int
The modification count.protected TreeBidiMap.Node
The last node returned by the iterator.protected final TreeBidiMap
The parent map.protected TreeBidiMap.Node
The next node to be returned by the iterator.protected final int
Whether to return KEY or VALUE order.protected TreeBidiMap.Node
The previous node in the sequence returned by the iterator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
Gets the data value for the lastReturnedNode field.final boolean
hasNext()
boolean
Checks to see if there is a previous element that can be iterated to.final Object
next()
previous()
Gets the previous element from the collection.final void
remove()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:OrderedIterator
Checks to see if there is a previous element that can be iterated to.- Specified by:
hasPrevious
in interfaceOrderedIterator
- Returns:
true
if the iterator has a previous element
-
previous
Description copied from interface:OrderedIterator
Gets the previous element from the collection.- Specified by:
previous
in 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()
-