coins.backend.util
Class BiLink

java.lang.Object
  extended bycoins.backend.util.BiLink
Direct Known Subclasses:
BiList

public class BiLink
extends java.lang.Object

Bi-directional list (middle links)


Field Summary
(package private)  java.lang.Object elem
          contents
(package private)  BiLink next
          points next element.
(package private)  BiLink prev
          points previous element.
 
Constructor Summary
(package private) BiLink()
          Used internally only.
(package private) BiLink(java.lang.Object obj)
          Create new link that has an object obj.
 
Method Summary
 BiLink addAfter(java.lang.Object obj)
          Insert an object after this link.
 BiLink addAllAfter(BiList list)
          Insert contents of list after this link.
 BiLink addAllBefore(BiList list)
          Insert contents of list before this link.
 BiLink addBefore(java.lang.Object obj)
          Insert an object before this link.
 boolean atEnd()
          Return true if this link is either end.
 java.lang.Object elem()
          Return contents of this link.
 BiLink insertAfter(BiLink link)
          Insert a link after this link.
 BiLink insertAllAfter(BiList list)
          Deprecated. renamed to addAllAfter.
 BiLink insertAllBefore(BiList list)
          Deprecated. renamed to addAllBefore.
 BiLink insertBefore(BiLink link)
          Insert a link before this link.
 BiLink next()
          Return next link.
 BiLink prev()
          Return previous link.
 void setElem(java.lang.Object obj)
          Replace contents of the link.
 BiLink unlink()
          Remove this link from the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elem

java.lang.Object elem
contents


next

BiLink next
points next element.


prev

BiLink prev
points previous element.

Constructor Detail

BiLink

BiLink()
Used internally only.


BiLink

BiLink(java.lang.Object obj)
Create new link that has an object obj. Used internally.

Method Detail

elem

public java.lang.Object elem()
Return contents of this link.


next

public BiLink next()
Return next link.


prev

public BiLink prev()
Return previous link.


atEnd

public boolean atEnd()
Return true if this link is either end.


setElem

public void setElem(java.lang.Object obj)
Replace contents of the link.


insertAfter

public BiLink insertAfter(BiLink link)
Insert a link after this link.

Parameters:
link - link to be inserted

addAfter

public BiLink addAfter(java.lang.Object obj)
Insert an object after this link.


insertBefore

public BiLink insertBefore(BiLink link)
Insert a link before this link.

Parameters:
link - link to be inserted

addBefore

public BiLink addBefore(java.lang.Object obj)
Insert an object before this link.


unlink

public BiLink unlink()
Remove this link from the list.

Returns:
the link just removed

insertAllBefore

public BiLink insertAllBefore(BiList list)
Deprecated. renamed to addAllBefore.

Insert contents of list before this link.


insertAllAfter

public BiLink insertAllAfter(BiList list)
Deprecated. renamed to addAllAfter.

Insert contents of list after this link.


addAllBefore

public BiLink addAllBefore(BiList list)
Insert contents of list before this link.


addAllAfter

public BiLink addAllAfter(BiList list)
Insert contents of list after this link.