|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jdo.spi.persistence.utility.DoubleLinkedList
public class DoubleLinkedList
This class defines a thread-safe double linked-list. The list is usable by any class that implements the com.forte.util.Linkable interface. This class allows a linkable object it be inserted or removed from anywhere in the list. RESTRICTION: An object can only be a member of 1 list at a time.
| Field Summary | |
|---|---|
Linkable |
head
Head of linked list. |
int |
size
Size of linked list. |
Linkable |
tail
Tail of linked list. |
| Constructor Summary | |
|---|---|
DoubleLinkedList()
Default constructor. |
|
| Method Summary | |
|---|---|
Linkable |
getHead()
Return the object at the head of a linked list. |
int |
getSize()
Return size of the linked list. |
Linkable |
getTail()
Return the object at the tail of a linked list. |
void |
insertAtHead(Linkable node)
Insert an object at the head of a linked list. |
void |
insertAtTail(Linkable node)
Insert an object at the tail of a linked list. |
void |
insertIntoList(Linkable afternode,
Linkable newnode)
Insert an object anywhere into the linked list. |
Linkable |
removeFromHead()
Remove and return an object from the head of a linked list. |
void |
removeFromList(Linkable node)
Remove the specified object from anywhere in the linked list. |
Linkable |
removeFromTail()
Remove and return an object from the tail of a linked list. |
java.lang.String |
toString()
Return a string representation of this DoubleLinkedList object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public Linkable head
public Linkable tail
public int size
| Constructor Detail |
|---|
public DoubleLinkedList()
| Method Detail |
|---|
public Linkable getHead()
public Linkable getTail()
public int getSize()
public void insertAtHead(Linkable node)
public void insertAtTail(Linkable node)
public Linkable removeFromHead()
public Linkable removeFromTail()
public void removeFromList(Linkable node)
public void insertIntoList(Linkable afternode,
Linkable newnode)
afternode - the new node will be inserted after this nodenewnode - the new node to be insertedpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||