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.
-
List()
-
-
Add(Object)
- Adds an object at the tail of the list.
-
AddAtHead(Object)
- Adds an object at the head of the list.
-
Contains(Object)
-
-
Copy()
-
-
Dump()
-
-
Elements()
-
-
GetContents()
-
-
main(String[])
-
-
Peek()
- Returns element at the tail (if present), but does not remove it from list.
-
PeekAtHead()
- Returns element at the head (if present), but does not remove it from list.
-
readExternal(ObjectInput)
-
-
Remove()
- Removes an object from the tail of the list.
-
RemoveAll()
-
-
RemoveElement(Object)
- Removes element
obj
from the list, checking for equality using the equals
operator.
-
RemoveFromHead()
- Removes an object from the head of the list.
-
Size()
-
-
toString()
-
-
writeExternal(ObjectOutput)
-
List
public List()
Add
public void Add(Object obj)
- Adds an object at the tail of the list.
AddAtHead
public void AddAtHead(Object obj)
- Adds an object at the head of the list.
Remove
public Object Remove()
- Removes an object from the tail of the list. Returns null if no elements available
RemoveFromHead
public Object RemoveFromHead()
- Removes an object from the head of the list. Returns null if no elements available
Peek
public Object Peek()
- Returns element at the tail (if present), but does not remove it from list.
PeekAtHead
public Object PeekAtHead()
- Returns element at the head (if present), but does not remove it from list.
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.
RemoveAll
public void RemoveAll()
Size
public int Size()
toString
public String toString()
- Overrides:
- toString in class Object
Dump
public String Dump()
GetContents
public Vector GetContents()
Elements
public Enumeration Elements()
Contains
public boolean Contains(Object obj)
Copy
public List Copy()
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index