JXTA

net.jxta.impl.util
Class Dlist

java.lang.Object
  extended by net.jxta.impl.util.Dlink
      extended by 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()
           
 
Method Summary
 void addFirst(Dlink ne)
           
 void addLast(Dlink ne)
           
 void clear()
           
 Dlink first()
           
 Dlink getFirst()
           
 Dlink getLast()
           
 boolean isEmpty()
           
 Dlink last()
           
 void putFirst(Dlink ne)
           
 void putLast(Dlink ne)
           
 Dlink removeFirst()
           
 Dlink removeLast()
           
 
Methods inherited from class net.jxta.impl.util.Dlink
isLinked, linkNewNext, linkNewPrev, next, prev, unlink
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dlist

public Dlist()
Method Detail

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()

JXSE