| java.lang.Object org.jgroups.util.List
All known Subclasses: org.jgroups.util.BoundedList, org.jgroups.util.Stack,
List | public class List implements Externalizable,Cloneable(Code) | | 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.
author: Bela Ban |
Inner Class :class Element | |
Inner Class :class ListEnumerator implements Enumeration | |
Constructor Summary | |
public | List() |
headtail | protected Element headtail(Code) | | |
add | public void add(Object obj)(Code) | | Adds an object at the tail of the list.
|
addAtHead | public void addAtHead(Object obj)(Code) | | Adds an object at the head of the list.
|
peek | public Object peek()(Code) | | Returns element at the tail (if present), but does not remove it from list.
|
peekAtHead | public Object peekAtHead()(Code) | | Returns element at the head (if present), but does not remove it from list.
|
remove | public Object remove()(Code) | | Removes an object from the tail of the list. Returns null if no elements available
|
removeAll | public void removeAll()(Code) | | |
removeElement | public Object removeElement(Object obj)(Code) | | Removes element obj from the list, checking for equality using the equals
operator. Only the first duplicate object is removed. Returns the removed object.
|
removeFromHead | public Object removeFromHead()(Code) | | Removes an object from the head of the list. Returns null if no elements available
|
|
|