com.irs.jam
Class DList

java.lang.Object
  |
  +--com.irs.jam.DList
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BindingList, ConditionList, ExpList

public class DList
extends java.lang.Object
implements java.io.Serializable

DList (doubly linked list)

See Also:
Serialized Form

Field Summary
protected  int _count
           
protected  DLink _head
           
 
Constructor Summary
DList()
           
DList(java.lang.Object ent)
           
 
Method Summary
protected  void addAfter(DLink current, DList list)
          Add a list after the given element
protected  void addAfter(DLink current, java.lang.Object ent)
          Add a single entry after the given element
protected  void addBefore(DLink current, DList list)
          Add a list after the given element
protected  void addBefore(DLink current, java.lang.Object ent)
          Add a single entry before the given element
 void append(DList list)
          Add at tail of list
 void append(java.lang.Object ent)
          Add at tail of list
 void clear()
          Remove all links
protected  void createHead()
          Create the start of the list
 java.lang.Object first()
          Return the first element of the list
 int getCount()
          Returns the number of elements in the list
 void insert(DList list)
           
 void insert(java.lang.Object ent)
          add at head of list
 boolean isEmpty()
          Returns whether the list has elements or not
 java.lang.Object last()
          Return the last element of the list
 java.lang.Object nth(int n)
          MJH - Return the nth (1-based) element of the list
 java.lang.Object pop()
          Return and remove head of list
protected  DLink remove(DLink current)
           
 java.lang.Object removeNth(int n)
          MJH - Remove the nth (1-based) element of the list
protected  DLink replace(DLink current, java.lang.Object ent)
           
 java.lang.Object replaceNth(java.lang.Object ent, int n)
          MJH - Set the nth (1-based) element of the list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_head

protected DLink _head

_count

protected int _count
Constructor Detail

DList

public DList()

DList

public DList(java.lang.Object ent)
Method Detail

insert

public void insert(java.lang.Object ent)
add at head of list

insert

public void insert(DList list)

append

public void append(java.lang.Object ent)
Add at tail of list

append

public void append(DList list)
Add at tail of list

clear

public void clear()
Remove all links

first

public java.lang.Object first()
Return the first element of the list

nth

public java.lang.Object nth(int n)
MJH - Return the nth (1-based) element of the list

last

public java.lang.Object last()
Return the last element of the list

pop

public java.lang.Object pop()
Return and remove head of list

getCount

public int getCount()
Returns the number of elements in the list

isEmpty

public boolean isEmpty()
Returns whether the list has elements or not

createHead

protected void createHead()
Create the start of the list

addAfter

protected void addAfter(DLink current,
                        java.lang.Object ent)
Add a single entry after the given element

addAfter

protected void addAfter(DLink current,
                        DList list)
Add a list after the given element

addBefore

protected void addBefore(DLink current,
                         java.lang.Object ent)
Add a single entry before the given element

addBefore

protected void addBefore(DLink current,
                         DList list)
Add a list after the given element

remove

protected DLink remove(DLink current)

removeNth

public java.lang.Object removeNth(int n)
MJH - Remove the nth (1-based) element of the list

replace

protected DLink replace(DLink current,
                        java.lang.Object ent)

replaceNth

public java.lang.Object replaceNth(java.lang.Object ent,
                                   int n)
MJH - Set the nth (1-based) element of the list