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 intdataTypeWhether to return KEY, VALUE, MAPENTRY or INVERSEMAPENTRY data.private intexpectedModificationsThe modification count.protected TreeBidiMap.NodelastReturnedNodeThe last node returned by the iterator.protected TreeBidiMapmainThe parent map.protected TreeBidiMap.NodenextNodeThe next node to be returned by the iterator.protected intorderTypeWhether to return KEY or VALUE order.protected TreeBidiMap.NodepreviousNodeThe 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.ObjectdoGetData()Gets the data value for the lastReturnedNode field.booleanhasNext()booleanhasPrevious()Checks to see if there is a previous element that can be iterated to.java.lang.Objectnext()java.lang.Objectprevious()Gets the previous element from the collection.voidremove()
-
-
-
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:
hasNextin interfacejava.util.Iterator
-
next
public final java.lang.Object next()
- Specified by:
nextin interfacejava.util.Iterator
-
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
public java.lang.Object previous()
Description copied from interface:OrderedIteratorGets the previous element from the collection.- Specified by:
previousin 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:
removein interfacejava.util.Iterator
-
-