nachos.kernel.threads
Class List.ListElement

java.lang.Object
  extended by nachos.kernel.threads.List.ListElement
Enclosing class:
List

protected static class List.ListElement
extends java.lang.Object

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" ("item") pointing to the item element on the list, and a "cdr" ("next") pointing to the next item on the list. A "list element" is allocated for each item to be put on the list; it is de-allocated when the item is removed. This means we don't need to keep a "next" pointer in every object we want to put on a list.


Field Summary
(package private)  java.lang.Object item
          Reference to item on the list.
(package private)  long key
          Priority, for a sorted list.
(package private)  List.ListElement next
          The next element on list, null if this is the last.
 
Constructor Summary
List.ListElement(java.lang.Object item, long sortKey)
          Initialize a list element, so it can be added somewhere on a list.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

next

List.ListElement next
The next element on list, null if this is the last.


key

long key
Priority, for a sorted list.


item

java.lang.Object item
Reference to item on the list.

Constructor Detail

List.ListElement

public List.ListElement(java.lang.Object item,
                        long sortKey)
Initialize a list element, so it can be added somewhere on a list.

Parameters:
item - The item to be put on the list, it can be any object.
sortKey - The priority of the item, if any.