mns
Class CommandThread

java.lang.Object
  extended by java.lang.Thread
      extended by mns.Command
          extended by mns.CommandThread
All Implemented Interfaces:
BioDeviceListener, java.lang.Cloneable, java.lang.Runnable, Commandable
Direct Known Subclasses:
SpeachThread

 class CommandThread
extends Command
implements BioDeviceListener

Author:
Martin Lukac For specific purposes a Threaded command is an internal class allowing to run commands on one self and generate some regular, cyclic, time-variant behavior. This command thread represents standard servo and control response sequence. THe relation between the different motor or control values can be specified and can generate potentially nice results Thread of this type is automatically: SINGLE_ACT and RANDOM_VALUE_MODE - it will replace any missing default values by random values with current settings

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface mns.Commandable
DELAYED_ACT, MULTIPLE_ACT, PERIODIC_ACT, RANDOM_VALUE_MODE, REPEAT_VALUE_MODE, RRANGE_VALUE_MODE, SINGLE_ACT
 
Constructor Summary
CommandThread(java.lang.String name)
           
CommandThread(java.lang.String[] data)
           
CommandThread(java.lang.String[] data, char key)
           
CommandThread(java.lang.String name, char key)
           
 
Method Summary
protected  void addListener()
          private method for adding this to the biodevices as a listener
 void bioEvent(BioDeviceEvent bdE)
          some commands can be coordinated through events such as speech or some other cyclic or random movements this serves to time coordinating them
 void energyConsumed(EnergyPrimitive ep)
           
 Command getParentThread()
           
 void run()
           
 void setParentThread(Command parentThread)
           
 
Methods inherited from class mns.Command
cloneCommand, getAssignDevices, getBioname, getCommand, getExecDependency, getExecMode, getExecType, getInstructions, getKey, getMode, getPart, getPeriod, isDone, isNominal, setAssignDevices, setCommand, setDone, setExecDependency, setExecMode, setexecPeriod, setExecType, setKey, setNominal, setPart, setSingleCom
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mns.Commandable
getName, setName
 

Constructor Detail

CommandThread

public CommandThread(java.lang.String name)
Parameters:
name -

CommandThread

public CommandThread(java.lang.String[] data)

CommandThread

public CommandThread(java.lang.String name,
                     char key)

CommandThread

public CommandThread(java.lang.String[] data,
                     char key)
Method Detail

energyConsumed

public void energyConsumed(EnergyPrimitive ep)

bioEvent

public void bioEvent(BioDeviceEvent bdE)
some commands can be coordinated through events such as speech or some other cyclic or random movements this serves to time coordinating them

Specified by:
bioEvent in interface BioDeviceListener
Parameters:
bdE - - caught BioDeviceEvent

addListener

protected void addListener()
private method for adding this to the biodevices as a listener

Overrides:
addListener in class Command

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

getParentThread

public Command getParentThread()
Returns:
Returns the parentThread.

setParentThread

public void setParentThread(Command parentThread)
Parameters:
parentThread - The parentThread to set.