|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.util.List
public class List
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.
Field Summary | |
---|---|
protected org.jgroups.util.List.Element |
head
|
protected java.lang.Object |
mutex
|
protected int |
size
|
protected org.jgroups.util.List.Element |
tail
|
Constructor Summary | |
---|---|
List()
|
Method Summary | |
---|---|
void |
add(java.lang.Object obj)
Adds an object at the tail of the list. |
void |
addAll(java.util.Collection c)
|
void |
addAtHead(java.lang.Object obj)
Adds an object at the head of the list. |
protected java.lang.Object |
clone()
|
boolean |
contains(java.lang.Object obj)
|
List |
copy()
|
java.lang.String |
dump()
|
java.util.Enumeration |
elements()
|
java.util.Vector |
getContents()
|
static void |
main(java.lang.String[] args)
|
java.lang.Object |
peek()
Returns element at the tail (if present), but does not remove it from list. |
java.lang.Object |
peekAtHead()
Returns element at the head (if present), but does not remove it from list. |
void |
readExternal(java.io.ObjectInput in)
|
java.lang.Object |
remove()
Removes an object from the tail of the list. |
void |
removeAll()
|
java.lang.Object |
removeElement(java.lang.Object obj)
Removes element obj from the list, checking for equality using the equals
operator. |
java.lang.Object |
removeFromHead()
Removes an object from the head of the list. |
int |
size()
|
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected org.jgroups.util.List.Element head
protected org.jgroups.util.List.Element tail
protected int size
protected final transient java.lang.Object mutex
Constructor Detail |
---|
public List()
Method Detail |
---|
public void add(java.lang.Object obj)
public void addAtHead(java.lang.Object obj)
public void addAll(java.util.Collection c)
public java.lang.Object remove()
public java.lang.Object removeFromHead()
public java.lang.Object peek()
public java.lang.Object peekAtHead()
public java.lang.Object removeElement(java.lang.Object obj)
obj
from the list, checking for equality using the equals
operator. Only the first duplicate object is removed. Returns the removed object.
public void removeAll()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String dump()
public java.util.Vector getContents()
public java.util.Enumeration elements()
public boolean contains(java.lang.Object obj)
public List copy()
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |