[ RCOS.java Home | RCOS Home | David's Home ]

ListElement CRC

Name:

ListElementHeader

Comment:

The following class defines a "list element" -- which is used to keep track of one item on a list. It is equivalent to a LISP cell, with a "car" ("next") pointing to the next element on the list, and a "cdr" ("item") pointing to the item on the list.

Internal data structures kept public so that List operations can access them directly.

Collaborators:

Responsibilities:

class ListElement {
   public:
     ListElement(void *itemPtr, int sortKey);   // initialize a list element

     ListElement *next;         // next element on list,
                                // NULL if this is the last
     int key;                   // priority, for a sorted list
     void *item;                // pointer to item on the list
};