|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgoldman.collection.AbstractCollection.AbstractLocator<E>
goldman.collection.set.SeparateChaining.Marker
protected class SeparateChaining.Marker
Field Summary |
---|
Fields inherited from class goldman.collection.AbstractCollection.AbstractLocator |
---|
versionNumber |
Method Summary | |
---|---|
boolean |
advance()
Advances to the next element in the collection (if there is one) and returns true . |
E |
get()
Returns the element associated with this locator. |
boolean |
hasNext()
|
boolean |
inCollection()
Returns true if and only if the locator is at an element of the collection. |
void |
remove()
Removes the item at the marker |
boolean |
retreat()
Moves the marker to the previous location |
Methods inherited from class goldman.collection.AbstractCollection.AbstractLocator |
---|
checkValidity, ignoreConcurrentModifications, ignorePriorConcurrentModifications, next, updateVersion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface goldman.collection.Locator |
---|
ignoreConcurrentModifications, ignorePriorConcurrentModifications |
Methods inherited from interface java.util.Iterator |
---|
next |
Method Detail |
---|
public boolean inCollection()
Locator
inCollection
in interface Locator<E>
public E get()
Locator
inCollection
method can be
used to determine if a tracked element is currently in the collection.
If the locator is at FORE or AFT then
a NoSuchElementException
is thrown.
get
in interface Locator<E>
NoSuchElementException
- the marker is logically
before the first element or after the last element in the set.public boolean advance()
Locator
true
. If the locator is already
at the last element of the collection then false
is returned
and the locator is moved to AFT.
If a call to advance
is made when the locator is at AFT,
an AtBoundaryException
is thrown. Starting with the locator
at FORE and calling advance
repeatedly until
false is returned will reach each element in the collection
exactly once.
advance
in interface Locator<E>
AtBoundaryException
- the marker had already advanced past the end
of the collection via an earlier call to either advance
or next
AtBoundaryException
- the locator is at AFT since there is
no place to advance.public boolean retreat()
retreat
in interface Locator<E>
slot
is one
that is in use.
The user program can use this return value to
recognize when a marker has moved before the start of the set.
AtBoundaryException
- the marker is at FORE because
retreating from FORE is impossible.public boolean hasNext()
hasNext
in interface Iterator<E>
public void remove()
remove
in interface Iterator<E>
NoSuchElementException
- the marker is
logically at FORE or AFT
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |