|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.virtuosotechnologies.lib.base.LinkedObject
Base class for elements in a "naked" circular linked list, i.e. it doesn't support the collections interface, but instead exposes the list cells. Useful for building larger data structures involving links without having the object and search overhead of using java.util.LinkedList internally.
The list is circular, e.g. there are never null pointers involved. You can create a "bounded" list using a delimiter element. The element whose next pointer points to the delimiter is the end, and the element whose prev pointer points to the delimiter is the beginning. As a corollary, an element that isn't linked up has both its next and prev pointers pointing to this.
Not synchronized. This is intended only to be a building block for larger data structures, so the synchronization policy is deferred to the client.
Constructor Summary | |
LinkedObject()
Constructor |
Method Summary | |
LinkedObject |
getNext()
Get the next element. |
LinkedObject |
getPrevious()
Get the previous element. |
void |
linkThisAfter(LinkedObject element)
Inserts this element after the given one. |
void |
linkThisBefore(LinkedObject element)
Inserts this element before the given one. |
void |
unlinkThis()
Remove this element from its current link. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LinkedObject()
Method Detail |
public LinkedObject getNext()
public LinkedObject getPrevious()
public void linkThisAfter(LinkedObject element)
public void linkThisBefore(LinkedObject element)
public void unlinkThis()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |