Package generic.stl
Class MapIteratorSTL<K,V>
java.lang.Object
generic.stl.MapIteratorSTL<K,V>
- All Implemented Interfaces:
IteratorSTL<Pair<K,V>>
- Direct Known Subclasses:
ReverseMapIteratorSTL
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected RedBlackNode<K, V> protected RedBlackTree<K, V> -
Method Summary
Modifier and TypeMethodDescriptionvoidassign(IteratorSTL<Pair<K, V>> otherIterator) 'Assigns' this iterator to be equivalent to the given iterator.IteratorSTL<Pair<K, V>> copy()Creates a copy of this iterator.IteratorSTL<Pair<K, V>> Devance the iterator to the previous position.IteratorSTL<Pair<K, V>> decrement(int n) Devances the iterator n positions.booleanget()Returns the current value of the iterator.IteratorSTL<Pair<K, V>> Advances the iterator to the next position.IteratorSTL<Pair<K, V>> increment(int n) Advances the iterator n positions.voidInserts the given value at the current position (the current value will be pushed to the next value).booleanisBegin()Returns true if the iterator is positioned on the first element of the collection.booleanisEnd()Returns true if the iterator is positioned past the last element of the collection.voidSets the current value of the iterator to the given value.
-
Field Details
-
tree
-
node
-
erased
protected boolean erased
-
-
Method Details
-
assign
Description copied from interface:IteratorSTL'Assigns' this iterator to be equivalent to the given iterator. This is equivalent to C++'s '=' overloading mechanism- Specified by:
assignin interfaceIteratorSTL<K>- Parameters:
otherIterator- The iterator to copy
-
decrement
Description copied from interface:IteratorSTLDevance the iterator to the previous position. This method is only supported in bidirectional iterators.- Specified by:
decrementin interfaceIteratorSTL<K>- Returns:
- a reference to the iterator itself
-
get
Description copied from interface:IteratorSTLReturns the current value of the iterator.- Specified by:
getin interfaceIteratorSTL<K>- Returns:
- the current value of the iterator.
-
increment
Description copied from interface:IteratorSTLAdvances the iterator to the next position.- Specified by:
incrementin interfaceIteratorSTL<K>- Returns:
- a reference to the iterator itself
-
insert
Description copied from interface:IteratorSTLInserts the given value at the current position (the current value will be pushed to the next value). The iterator will be positioned on the new value.- Specified by:
insertin interfaceIteratorSTL<K>- Parameters:
value- the value to insert into the collection.
-
isBegin
public boolean isBegin()Description copied from interface:IteratorSTLReturns true if the iterator is positioned on the first element of the collection. If the collection is empty, this will always return false.- Specified by:
isBeginin interfaceIteratorSTL<K>- Returns:
- true if the iterator is positioned on the first element of the collection.
-
isEnd
public boolean isEnd()Description copied from interface:IteratorSTLReturns true if the iterator is positioned past the last element of the collection. If the collection is empty, this will always return true.- Specified by:
isEndin interfaceIteratorSTL<K>- Returns:
- true if the iterator is positioned past the last element of the collection.
-
set
Description copied from interface:IteratorSTLSets the current value of the iterator to the given value.- Specified by:
setin interfaceIteratorSTL<K>- Parameters:
value- the value to set at the iterator position
-
copy
Description copied from interface:IteratorSTLCreates a copy of this iterator.- Specified by:
copyin interfaceIteratorSTL<K>- Returns:
- a copy of this iterator.
-
decrement
Description copied from interface:IteratorSTLDevances the iterator n positions.- Specified by:
decrementin interfaceIteratorSTL<K>- Returns:
- a reference to the iterator itself
-
increment
Description copied from interface:IteratorSTLAdvances the iterator n positions.- Specified by:
incrementin interfaceIteratorSTL<K>- Returns:
- a reference to the iterator itself
-
equals
-