|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.LinkableList
public class LinkableList
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 |
---|
public LinkableList()
Method Detail |
---|
public int size()
public boolean empty()
public Linkable first()
public Linkable last()
public void remove(Linkable linkable)
public void addAfter(Linkable referenceLinkable, Linkable insertLinkable)
public void addBefore(Linkable referenceLinkable, Linkable insertLinkable)
public void insert(Linkable linkable)
public void add(Linkable linkable)
public void append(Linkable linkable)
public java.lang.String toString()
toString
in class java.lang.Object
public Linkable next(Linkable linkable)
public Linkable prev(Linkable linkable)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |