ariba.util.core
Class LinkableList

java.lang.Object
  extended by ariba.util.core.LinkableList

public class LinkableList
extends java.lang.Object

LinkableList implements a fairly straightforward doubly linked list. The only points are that one should never follow or modify the links themselves but make use of the cover fuctions within this class. For example, DO NOT: Shme shme = list.first(); shme.remove(); DO: Shme shme = list.first(); list.remove(shme); Perhaps I will put this in it's own package sometime soon but for now limit yourself to public members of this class. A short dicussion in Linkable.java discusses how to implement the Linkable interface.


Constructor Summary
LinkableList()
           
 
Method Summary
 void add(Linkable linkable)
          the Linkable is put somewhere in the list
 void addAfter(Linkable referenceLinkable, Linkable insertLinkable)
          the insertLinkable is "inserted" into the list after the referenceLinkable
 void addBefore(Linkable referenceLinkable, Linkable insertLinkable)
          the insertLinkable is "inserted" into the list before the referenceLinkable
 void append(Linkable linkable)
          the Linkable is put at the tail of the list (Currently this is not optimized - the list must be walked to the end)
 boolean empty()
           
 Linkable first()
           
 void insert(Linkable linkable)
          the Linkable is put at the head of the list
 Linkable last()
           
 Linkable next(Linkable linkable)
          return the next Linkable following the Linkable passed in
 Linkable prev(Linkable linkable)
          return the prev Linkable following the Linkable passed in
 void remove(Linkable linkable)
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinkableList

public LinkableList()
Method Detail

size

public int size()

empty

public boolean empty()

first

public Linkable first()

last

public Linkable last()

remove

public void remove(Linkable linkable)

addAfter

public void addAfter(Linkable referenceLinkable,
                     Linkable insertLinkable)
the insertLinkable is "inserted" into the list after the referenceLinkable


addBefore

public void addBefore(Linkable referenceLinkable,
                      Linkable insertLinkable)
the insertLinkable is "inserted" into the list before the referenceLinkable


insert

public void insert(Linkable linkable)
the Linkable is put at the head of the list


add

public void add(Linkable linkable)
the Linkable is put somewhere in the list


append

public void append(Linkable linkable)
the Linkable is put at the tail of the list (Currently this is not optimized - the list must be walked to the end)


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

next

public Linkable next(Linkable linkable)
return the next Linkable following the Linkable passed in


prev

public Linkable prev(Linkable linkable)
return the prev Linkable following the Linkable passed in



AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.