|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - The type of the elements which are stored at positions in the
backing abstract data structure.@Revision(value="$Revision: 1.6 $",
date="$Date: 2006/12/16 17:53:21 $",
tag="$Name: $")
public interface Position<T>
A combination of the ImmutablePosition and SingletonInterface
interfaces which adds support for the modification of the element at this
position through SingletonInterface.set(Object) and it's removal from
the backing abstract data structure with remove().
Positions, in general, may support concurrent modifications to the backing
abstract data structure, but are not required to. In the event that a
position does not support concurrent modification, it should throw
ConcurrentModificationException rather than fail at some
later time, in a non-deterministic way. This is the basis of the
fail-fast behavior of the rcf.core.util.collection.iterator
package.
Some implementations will throw
ConcurrentModificationException in response to any
modification other than those through a single position object. Others will
only throw an exception for structural modifications which did not go through
the position object. Still others will support concurrent modifications
without exceptions. Because these exceptions are optional they should be used
for debugging only, and cannot be relied on for correctness.
In order to avoid using exceptions to decide normal control flow, the methods
isRemoved(), isValid() and
ImmutablePosition.isSentinel() are provided. See the method
documentation for more details.
TODO: Javadoc review, Seal/Finalize
| Method Summary | |
|---|---|
boolean |
isRemoved()
Determine if this position has been removed from the backing abstract data structure. |
boolean |
isValid()
Determine if there has been a concurrent modification to the backing abstract data structure. |
T |
remove()
Remove this position, and the element associated with it from the backing abstract data structure, and return the element. |
T |
set(T a)
Set the content element of this position, and possibly change this position's relationship to other positions in the backing abstract data structure. |
| Methods inherited from interface rcf.core.util.position.ImmutablePosition |
|---|
equals, isCompatible, isSentinel |
| Methods inherited from interface rcf.core.util.groups.ImmutableSingletonInterface |
|---|
get |
| Methods inherited from interface rcf.core.util.groups.ImmutableSingletonInterface |
|---|
get |
| Method Detail |
|---|
boolean isRemoved()
true if this position has been removed from the
backing abstract data structure.
ConcurrentModificationException - The abstract data structure has
been modified through another
object.boolean isValid()
false in
all cases where any method may throw a
ConcurrentModificationException.
true indicates that this position is still valid
(though it may have been removed, see isRemoved()) in the
backing abstract data structure. This also indicates that no
method on this object will throw a
ConcurrentModificationException at the time of this call.T remove()
IllegalStateException - This position and it's
associated element have already
been removed.
SentinelPositionException - This is a sentinel position, and
therefor cannot be removed.ImmutableSingletonInterface.get()T set(T a)
set in interface SingletonInterface<T>a - The new content element of this position.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||