os
Class ProcessTable

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--os.Queue
                          |
                          +--os.ProcessTable

public class ProcessTable
extends Queue

Implements a process table for managing process in the Bot Operating System.

Version:
1.0
Author:
Thaddeus O. Cooper (cooper@tweenproject.org)
See Also:
Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ProcessTable()
           
 
Method Summary
 void addProcess(OSProcess p)
          Adds a process to the end of the queue.
 OSProcess getNextProcess()
          Gets the next process off of the queue to run.
 OSProcess getProcess(int id)
          Gets a specific process from the queue using the specified id.
 java.lang.String toString()
          Create a string representation of the current state of the queue.
 
Methods inherited from class os.Queue
get, main
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcessTable

public ProcessTable()
Method Detail

getNextProcess

public OSProcess getNextProcess()
Gets the next process off of the queue to run.
Returns:
the next OSProcess to run.

addProcess

public void addProcess(OSProcess p)
Adds a process to the end of the queue.
Parameters:
p - the process to add to the end of the queue.

getProcess

public OSProcess getProcess(int id)
Gets a specific process from the queue using the specified id.
Parameters:
id - the id of the process to retrieve from the process queue.
Returns:
the specified process or null if it does not exist.

toString

public java.lang.String toString()
Create a string representation of the current state of the queue.
Overrides:
toString in class java.util.Vector
Returns:
a String that represents the current state of the queue.