|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.util.UtlPlist<T>
public class UtlPlist<T>
Doubly linked 'pointer' list.
This class represents a linked list. As opposed to UtlPlist
, this
list allows the same object to be linked into multiple lists.
This class IS NOT intended to be used by end users.
Nested Class Summary | |
---|---|
static class |
UtlPlist.Element<T>
The default element class. |
static class |
UtlPlist.ElementFactory<T>
The pool factory for the default element. |
Method Summary | ||
---|---|---|
UtlPlist.Element<T> |
append(T object)
Append an object to a list. |
|
UtlPlist.Element<T> |
append(UtlPlist.Element<T> element)
Append an element to a list. |
|
void |
clear()
Clears a list. |
|
int |
count()
|
|
static
|
create()
Create a list that uses the default indirection element. |
|
UtlPlist.Element<T> |
first()
Get the first list element. |
|
UtlPlist.Element<T> |
last()
Get the last list element. |
|
UtlPlist.Element<T> |
prepend(T object)
Prepend an object to a list. |
|
void |
remove(UtlPlist.Element<T> element)
Remove an element from a list. |
|
String |
toString()
Get a string representation of the list |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static <T> UtlPlist<T> create()
public final UtlPlist.Element<T> prepend(T object)
object
- The object to be prepended. This value can be null.
This method prepends an object to a list i.e. adds the object before the first object in the list.
public final UtlPlist.Element<T> append(T object)
object
- The object to be appended. This value can be null.
This method appends an object to a list i.e. adds the object after the last object in the list.
public final UtlPlist.Element<T> append(UtlPlist.Element<T> element)
element
- The element to be appended. This value cannot be null.
This method appends an element to a list i.e. adds the element after the last element in the list.
public final UtlPlist.Element<T> first()
This method returns the first element in the list.
public final UtlPlist.Element<T> last()
This method returns the last element in the list.
public final void remove(UtlPlist.Element<T> element)
Removing an element from a list using this method is preferred since it puts the removed element into the element pool enabling reuse of pool object i.e. reduced garbage collection
public final int count()
public final void clear()
This method empties out a list i.e. all elements are removed
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |