|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.util.UtlListElement
com.neeve.util.UtlList
public class UtlList
Doubly linked list.
This class represents a linked list. Elements in such a list have to be of
type UtlListElement
This class IS NOT intended to be used by end users.
Field Summary |
---|
Fields inherited from class com.neeve.util.UtlListElement |
---|
count, head, next, prev |
Method Summary | |
---|---|
void |
append(UtlListElement element)
Append an element to the list. |
void |
clear()
Clears a list. |
static UtlList |
create()
Factory method - Creates a list This method creates a new linked list. |
UtlListElement |
first()
Get the first element in the list. |
UtlListElement |
last()
Get the last element in the list. |
void |
prepend(UtlListElement element)
Prepend an element to the list. |
void |
prune(UtlListElement element,
int num)
Prunes a portion of the list |
String |
toString()
Get a string representation of the list |
Methods inherited from class com.neeve.util.UtlListElement |
---|
count, insertAfter, insertBefore, isLinked, next, previous, unlink, wipe |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static UtlList create()
This method creates a new linked list.
public final void prepend(UtlListElement element)
element
- The element to be prepended
This method prepends an element to a list i.e. adds the element before the first element in the list.
public final void append(UtlListElement element)
element
- The element to be appended
This method appends an element to a list i.e. adds the element after the last element in the list.
public final UtlListElement first()
This method returns the first element in the list.
public final UtlListElement last()
This method returns the last element in the list.
public final void prune(UtlListElement element, int num)
element
- The element upto but excluding which the list is to be
cleared. A value of null is the same as specifying that the entire
list needs to be cleared.num
- The number of elements that are to be removed
This method removes all elements upto but excluding the specified element from the list.
public final void clear()
This method empties out a list i.e. all references to previously linked elements are released and the count set to zero.
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |