|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.limegroup.gnutella.util.DoublyLinkedList
A classic doubly-linked list. Unlike the LinkedList class in the JDK, this provides way a way to refer to elements of the list (each of type ListElement) directly, avoiding linear-time searches when you wish to remove an element. This currently only has a minimal set of operations.
This class is not thread-safe. All the access to the list should be synchronized externally if required.
| Nested Class Summary | |
static class |
DoublyLinkedList.ListElement
An element of the linked list. |
| Constructor Summary | |
DoublyLinkedList()
Creates new empty DoublyLinkedList |
|
| Method Summary | |
DoublyLinkedList.ListElement |
addLast(java.lang.Object value)
Inserts an object at the end of the list, returning its corresponding element. |
void |
clear()
Removes all entries from this list |
boolean |
contains(DoublyLinkedList.ListElement e)
Returns true if this contains the given ListElement. |
java.util.Iterator |
iterator()
|
void |
remove(DoublyLinkedList.ListElement element)
Removes the specified element from the list |
DoublyLinkedList.ListElement |
removeFirst()
Removes and returns the first element from the list |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DoublyLinkedList()
| Method Detail |
public DoublyLinkedList.ListElement addLast(java.lang.Object value)
value - the value of the new element.
public DoublyLinkedList.ListElement removeFirst()
public void remove(DoublyLinkedList.ListElement element)
element - The element to be removed. This must be an element
of this.public void clear()
public java.util.Iterator iterator()
public boolean contains(DoublyLinkedList.ListElement e)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||