|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.app.util.ScalableDeque.Element<E>
E - The type of element held by the dequestatic class ScalableDeque.Element<E>
A deque-internal class for wrapping elements within the deque.
This class maintains a doubly-linked list of all the elements
in the deque. This class relies on ScalableDeque to
maintain correct references to to the head and tail of this
list, and also to update it accordingly on additions and
removals.
The value of the elements themselves are refered to by ManagedReference instances if they implement ManagedObject or are refered to using a standard Java
reference.
Element instances use their value's hash code, but can
be distinguished by their id, which corresponds to the
id assigned to them at the time of their addition to the deque.
This method of hashing has the effect that when an Element is added to the deque, and subsequently added to the
backing map, the deque can locate all instances of the element
by using the element's hash code. This behavior is required to
correctly support the random access behavior of remove, removeFirstOccurrence, removeLastOccurrence, and removeAll.
ScalableDeque.ElementMatcher| Constructor Summary | |
|---|---|
ScalableDeque.Element(E value,
Long id)
Constructs a new Element with the provided id to contain the value. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
Returns true if o is an instance of Element, contains the same value as this instance and has
the same id. |
(package private) long |
getId()
Returns the unique id of this Element. |
E |
getValue()
Returns the value contained by this element. |
int |
hashCode()
Returns the hash code provided by the value contained by this element. |
(package private) ScalableDeque.Element<E> |
next()
Returns the Element after this instance in the
deque, or null if this element is the tail of the
deque. |
(package private) ScalableDeque.Element<E> |
prev()
Returns the Element before this instance in the
deque, or null if this element is the head of the
deque. |
(package private) void |
setNext(ScalableDeque.Element<E> next)
Sets the link from this Element to the next
Element in the deque to next. |
(package private) void |
setPrev(ScalableDeque.Element<E> prev)
Sets the link from this Element to the previous
Element in the deque to prev. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ScalableDeque.Element(E value,
Long id)
Element with the provided id to contain the value.
value - the value held by this Elementid - the id of this element| Method Detail |
|---|
public boolean equals(Object o)
true if o is an instance of Element, contains the same value as this instance and has
the same id.
equals in class Objecto -
true if o is an instance of Element, contains the same value as this instance and has
the same id.ScalableDeque.ElementMatcherpublic int hashCode()
hashCode in class Objectlong getId()
Element.
public E getValue()
ScalableDeque.Element<E> next()
Element after this instance in the
deque, or null if this element is the tail of the
deque.
Element after this instance in the
deque, or null if this element is the tail
of the deque.ScalableDeque.Element<E> prev()
Element before this instance in the
deque, or null if this element is the head of the
deque.
Element before this instance in the
deque, or null if this element is the head
of the deque.void setNext(ScalableDeque.Element<E> next)
Element to the next
Element in the deque to next.
void setPrev(ScalableDeque.Element<E> prev)
Element to the previous
Element in the deque to prev.
public String toString()
toString in class Object
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||