JOB iterators extend java.util.Iterator
adding functionality to traverse JOB
maps in either direction. Instances of JOB iterators are created by
JobEntrySet.iterator()
or JobEntrySet.iterator(Object)
.
If the iterator has been created using JobEntrySet.iterator()
and
if the first method call is Iterator.next()
,
then iteration starts at the first entry of the backed JOB map.
If the iterator has been created using JobEntrySet.iterator()
and
if the first method call on a newly created JOB iterator is JobIterator.previous()
,
then iteration starts at the last entry of the backed JOB map.
Applications may use the following methods to traverse the backed JOB map in either direction:
Object next() Object previous()
Note
: Alternating calls to next()
and previous()
will not
return the same entry.
Instead, the entry next or previously stored relatively to the last returned entry is returned.
This is in contrast to list iterators implemented by JDK.
Applications may use the following methods to position the cursor at the first or last element:
Object first() Object last()