Class TreeBidiMap.ViewIterator
- java.lang.Object
-
- org.apache.commons.collections.bidimap.TreeBidiMap.ViewIterator
-
- All Implemented Interfaces:
java.util.Iterator
,OrderedIterator
- Direct Known Subclasses:
TreeBidiMap.ViewMapIterator
- Enclosing class:
- TreeBidiMap
static class TreeBidiMap.ViewIterator extends java.lang.Object implements OrderedIterator
An iterator over the map.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
dataType
Whether to return KEY, VALUE, MAPENTRY or INVERSEMAPENTRY data.private int
expectedModifications
The modification count.protected TreeBidiMap.Node
lastReturnedNode
The last node returned by the iterator.protected TreeBidiMap
main
The parent map.protected TreeBidiMap.Node
nextNode
The next node to be returned by the iterator.protected int
orderType
Whether to return KEY or VALUE order.protected TreeBidiMap.Node
previousNode
The previous node in the sequence returned by the iterator.
-
Constructor Summary
Constructors Constructor Description ViewIterator(TreeBidiMap main, int orderType, int dataType)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
doGetData()
Gets the data value for the lastReturnedNode field.boolean
hasNext()
boolean
hasPrevious()
Checks to see if there is a previous element that can be iterated to.java.lang.Object
next()
java.lang.Object
previous()
Gets the previous element from the collection.void
remove()
-
-
-
Field Detail
-
main
protected final TreeBidiMap main
The parent map.
-
orderType
protected final int orderType
Whether to return KEY or VALUE order.
-
dataType
protected final int dataType
Whether to return KEY, VALUE, MAPENTRY or INVERSEMAPENTRY data.
-
lastReturnedNode
protected TreeBidiMap.Node lastReturnedNode
The last node returned by the iterator.
-
nextNode
protected TreeBidiMap.Node nextNode
The next node to be returned by the iterator.
-
previousNode
protected TreeBidiMap.Node previousNode
The previous node in the sequence returned by the iterator.
-
expectedModifications
private int expectedModifications
The modification count.
-
-
Constructor Detail
-
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 Detail
-
hasNext
public final boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator
-
next
public final java.lang.Object next()
- Specified by:
next
in interfacejava.util.Iterator
-
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
public java.lang.Object 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
protected java.lang.Object doGetData()
Gets the data value for the lastReturnedNode field.- Returns:
- the data value
-
remove
public final void remove()
- Specified by:
remove
in interfacejava.util.Iterator
-
-