All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JObserve.Linkage

java.lang.Object
   |
   +----JObserve.Linkage

public class Linkage
extends Object
Linkage Links for linked lists, basically just a pair of forward and reverse links to similar objects and a generic object pointer. The "backwards" pointer in the first object points to the last object in the list; the "forward" pointer of the last element points to the first element forming a doubly linked ring structure. Generally, the list head is an empty element and the presence of a single entry is taken as an empty list. This was called QLinkage in the old C routines and all member functions started with 'Q'.


Constructor Index

 o Linkage()
Default element constructor

Method Index

 o Empty()
Test a list for the empty condition The list is considered empty if a single entry, the head remains.
 o Init()
Initialize an empty list head.
 o InsertAfter(Linkage)
Insert a new element after a given element Call from given element.
 o InsertBefore(Linkage)
Insert a new element before a given element Call from given element.
 o InsertHead(Linkage)
Insert a new element at the head of the list.
 o InsertTail(Linkage)
Insert a new element at the tail of the list.
 o Predecessor()
Return the predecessor of this element.
 o RemoveElement()
Remove this element from the list.
 o RemoveHead()
Remove the element at the front of the list.
 o RemoveTail()
Remove the element at the end of the list.
 o Replace(Linkage)
Replace one link in a list with another
 o Successor()
Return the successor of this element.
 o Unlink()
Unlink an element

Constructors

 o Linkage
 public Linkage()
Default element constructor

Methods

 o Init
 public Linkage Init()
Initialize an empty list head.

Returns:
Linkage the (start) of a linked list
 o Unlink
 public Linkage Unlink()
Unlink an element

Returns:
Linkage the element
 o Predecessor
 public Linkage Predecessor()
Return the predecessor of this element. A null element pointer returns a null predecessor pointer. A single element list, returns a pointer to the given element.

Returns:
Linkage the previous element of the list.
 o Replace
 public Linkage Replace(Linkage replacement)
Replace one link in a list with another

Returns:
Linkage the old, now unlinked element
 o Successor
 public Linkage Successor()
Return the successor of this element. A null element returns a null successor. A single element list, returns a pointer to the given element.

Returns:
Linkage the next element of the list.
 o InsertHead
 public Linkage InsertHead(Linkage NewElement)
Insert a new element at the head of the list. Call from list head.

Parameters:
New - first element for the linked list.
Returns:
Linkage the added element.
 o InsertTail
 public Linkage InsertTail(Linkage NewElement)
Insert a new element at the tail of the list. Call from list head.

Parameters:
Linkage - New last element for the linked list.
Returns:
Linkage the new last element of the linked list.
 o InsertBefore
 public Linkage InsertBefore(Linkage NewElement)
Insert a new element before a given element Call from given element.

Parameters:
Linkage - New element to be added to the linked list.
Returns:
Linkage the added element
 o InsertAfter
 public Linkage InsertAfter(Linkage NewElement)
Insert a new element after a given element Call from given element.

Parameters:
Linkage - New element to be added to the linked list.
Returns:
Linkage the added element
 o RemoveHead
 public Linkage RemoveHead()
Remove the element at the front of the list. Since the Head element is an empty place holder, the next element (the first real one) is unlinked. Call from list head.

Returns:
Linkage the deleted element, if null a one element list.
 o RemoveTail
 public Linkage RemoveTail()
Remove the element at the end of the list. Call from list head.

Returns:
Linkage the deleted element, if null a one element list.
 o RemoveElement
 public Linkage RemoveElement()
Remove this element from the list.

Returns:
Linkage the deleted element
 o Empty
 public boolean Empty()
Test a list for the empty condition The list is considered empty if a single entry, the head remains.

Returns:
boolean True if there's only a single entry (the head).

All Packages  Class Hierarchy  This Package  Previous  Next  Index