Back to index

wims  3.65+svn20090927
Public Member Functions | Package Attributes
rene.util.list.ListClass Class Reference

A class for a list of things. More...

Collaboration diagram for rene.util.list.ListClass:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ListClass ()
 Generate an empty list.
void append (ListElement l)
 Append a node to the list.
void prepend (ListElement l)
void insert (ListElement l, ListElement after)
void init (ListElement l)
 initialize the list with a single element.
void remove (ListElement l)
 Remove a node from the list.
void removeall ()
 Empty the list.
void removeAfter (ListElement e)
 remove everything after e
ListElement first ()
ListElement last ()
String toString ()
 Prints the class.

Package Attributes

ListElement First
ListElement Last

Detailed Description

A class for a list of things.

The list is forward and backward chained.

See also:
rene.list.ListElement

Definition at line 9 of file ListClass.java.


Constructor & Destructor Documentation

Generate an empty list.

Definition at line 15 of file ListClass.java.

       {      First=null; Last=null;
       }

Member Function Documentation

Append a node to the list.

Definition at line 22 of file ListClass.java.

       {      if (Last==null) init(l);
              else
              {      Last.next(l); l.previous(Last); Last=l;
                     l.next(null); l.list(this);
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
First ListElement.

Definition at line 101 of file ListClass.java.

{ return First; }

Here is the caller graph for this function:

initialize the list with a single element.

Definition at line 56 of file ListClass.java.

       {      Last=First=l;
              l.previous(null); l.next(null);
              l.list(this);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.util.list.ListClass.insert ( ListElement  l,
ListElement  after 
) [inline]

Definition at line 43 of file ListClass.java.

       {      if (after==Last) append(l);
              else if (after==null) prepend(l);
              else
              {      after.next().previous(l);
                     l.next(after.next());
                     after.next(l); l.previous(after); l.list(this);
              }
       }

Here is the call graph for this function:

Returns:
Last ListElement.

Definition at line 106 of file ListClass.java.

{ return Last; }

Here is the caller graph for this function:

Definition at line 30 of file ListClass.java.

       {      if (First==null) init(l);
              else
              {      First.previous(l); l.next(First); First=l;
                     l.previous(null); l.list(this);
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Remove a node from the list.

The node really should be in the list, which is not checked.

Definition at line 66 of file ListClass.java.

       {      if (First==l)
              {      First=l.next();
                     if (First!=null) First.previous(null);
                     else Last=null;
              }
              else if (Last==l)
              {      Last=l.previous();
                     if (Last!=null) Last.next(null);
                     else First=null;
              }
              else
              {      l.previous().next(l.next());
                     l.next().previous(l.previous());
              }
              l.next(null); l.previous(null); l.list(null);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

remove everything after e

Definition at line 93 of file ListClass.java.

       {      e.next(null);
              Last=e;
       }

Here is the call graph for this function:

Empty the list.

Definition at line 87 of file ListClass.java.

       {      First=null;
              Last=null;
       }

Here is the caller graph for this function:

String rene.util.list.ListClass.toString ( ) [inline]

Prints the class.

Definition at line 111 of file ListClass.java.

       {      ListElement e=First;
              String s="";
              while (e!=null)
              {      s=s+e.content().toString()+", ";
                     e=e.next();
              }
              return s;
       }

Here is the call graph for this function:


Member Data Documentation

Definition at line 10 of file ListClass.java.

Definition at line 10 of file ListClass.java.


The documentation for this class was generated from the following file: