All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JavaGroups.List

java.lang.Object
   |
   +----JavaGroups.List

public class List
extends Object
implements Externalizable
Doubly-linked list. Elements can be added at head or tail and removed from head/tail. This class is tuned for element access at either head or tail, random access to elements is not very fast; in this case use Vector. Concurrent access is supported: a thread is blocked while another thread adds/removes an object. When no objects are available, removal returns null.


Constructor Index

 o List()

Method Index

 o Add(Object)
Adds an object at the tail of the list.
 o AddAtHead(Object)
Adds an object at the head of the list.
 o Contains(Object)
 o Copy()
 o Dump()
 o Elements()
 o GetContents()
 o main(String[])
 o Peek()
Returns element at the tail (if present), but does not remove it from list.
 o PeekAtHead()
Returns element at the head (if present), but does not remove it from list.
 o readExternal(ObjectInput)
 o Remove()
Removes an object from the tail of the list.
 o RemoveAll()
 o RemoveElement(Object)
Removes element obj from the list, checking for equality using the equals operator.
 o RemoveFromHead()
Removes an object from the head of the list.
 o Size()
 o toString()
 o writeExternal(ObjectOutput)

Constructors

 o List
 public List()

Methods

 o Add
 public void Add(Object obj)
Adds an object at the tail of the list.

 o AddAtHead
 public void AddAtHead(Object obj)
Adds an object at the head of the list.

 o Remove
 public Object Remove()
Removes an object from the tail of the list. Returns null if no elements available

 o RemoveFromHead
 public Object RemoveFromHead()
Removes an object from the head of the list. Returns null if no elements available

 o Peek
 public Object Peek()
Returns element at the tail (if present), but does not remove it from list.

 o PeekAtHead
 public Object PeekAtHead()
Returns element at the head (if present), but does not remove it from list.

 o RemoveElement
 public Object RemoveElement(Object obj)
Removes element obj from the list, checking for equality using the equals operator. Only the first duplicate object is removed. Returns the removed object.

 o RemoveAll
 public void RemoveAll()
 o Size
 public int Size()
 o toString
 public String toString()
Overrides:
toString in class Object
 o Dump
 public String Dump()
 o GetContents
 public Vector GetContents()
 o Elements
 public Enumeration Elements()
 o Contains
 public boolean Contains(Object obj)
 o Copy
 public List Copy()
 o writeExternal
 public void writeExternal(ObjectOutput out) throws IOException
 o readExternal
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index