|
|||||||||
| Home >> All >> com >> virtuosotechnologies >> lib >> [ base overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.virtuosotechnologies.lib.base
Class LinkedObject

java.lang.Objectcom.virtuosotechnologies.lib.base.LinkedObject
- public class LinkedObject
- extends java.lang.Object
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.
| Field Summary | |
private LinkedObject |
next_
|
private LinkedObject |
prev_
|
| 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 |
| Field Detail |
next_
private LinkedObject next_
prev_
private LinkedObject prev_
| Constructor Detail |
LinkedObject
public LinkedObject()
- Constructor
| Method Detail |
getNext
public LinkedObject getNext()
- Get the next element.
getPrevious
public LinkedObject getPrevious()
- Get the previous element.
linkThisAfter
public void linkThisAfter(LinkedObject element)
- Inserts this element after the given one. Removes this element
from any link it is already part of first.
linkThisBefore
public void linkThisBefore(LinkedObject element)
- Inserts this element before the given one. Removes this element
from any link it is already part of first.
unlinkThis
public void unlinkThis()
- Remove this element from its current link. Does nothing if it
is not in a link.
|
|||||||||
| Home >> All >> com >> virtuosotechnologies >> lib >> [ base overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.virtuosotechnologies.lib.base.LinkedObject