pt.runtime
Class TaskThread

java.lang.Object
  extended by java.lang.Thread
      extended by pt.runtime.TaskThread
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
InteractiveThread, PipelineThread, SubstituteThread, WorkerThread

public abstract class TaskThread
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.util.Stack<TaskID> currentTaskStack
           
protected  Taskpool taskpool
           
protected  int threadID
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TaskThread(Taskpool taskpool)
           
 
Method Summary
 TaskID currentExecutingTask()
          Return the currently executing TaskID by this TaskThread
protected  boolean executeTask(TaskID task)
          Executes the current task for this thread, and stores the result in the TaskID
 int getThreadID()
           
 java.lang.Object getTP()
           
 java.lang.Object getTP(java.lang.String key)
           
 void setTP(java.lang.Object tp)
           
 void setTP(java.lang.Object tp, java.lang.String key)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentTaskStack

protected java.util.Stack<TaskID> currentTaskStack

threadID

protected int threadID

taskpool

protected Taskpool taskpool
Constructor Detail

TaskThread

public TaskThread(Taskpool taskpool)
Method Detail

executeTask

protected boolean executeTask(TaskID task)
Executes the current task for this thread, and stores the result in the TaskID

Returns:
true if task executed successfully, false otherwise

currentExecutingTask

public TaskID currentExecutingTask()
Return the currently executing TaskID by this TaskThread

Returns:
The current TaskID, or null if not working on a task

getThreadID

public int getThreadID()

setTP

public void setTP(java.lang.Object tp)

getTP

public java.lang.Object getTP()

setTP

public void setTP(java.lang.Object tp,
                  java.lang.String key)

getTP

public java.lang.Object getTP(java.lang.String key)