net.jxta.impl.util
Class Dlist
java.lang.Object
net.jxta.impl.util.Dlink
net.jxta.impl.util.Dlist
public class Dlist
- extends Dlink
A cheap doubly linked list.
It is far less general than java's LinkedList but permits much better
removal performance from the middle of the list because a contained
element and the corresponding chaining object are one and the same.
The major inconvenient of Dlink is that it is a class, not an
interface. Making it an interface does not make sense since one would have
to re-implement it entirely. A DList is just a stand-alone
Dlink with just a couple of additional convenience methods.
Note this class does not keep an element count. The way element removal
works makes it impossible. Do it from the outside.
Constructor Summary |
Dlist()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Dlist
public Dlist()
putLast
public void putLast(Dlink ne)
putFirst
public void putFirst(Dlink ne)
last
public Dlink last()
first
public Dlink first()
addLast
public void addLast(Dlink ne)
addFirst
public void addFirst(Dlink ne)
getLast
public Dlink getLast()
getFirst
public Dlink getFirst()
removeLast
public Dlink removeLast()
removeFirst
public Dlink removeFirst()
clear
public void clear()
isEmpty
public boolean isEmpty()