pilot
Class Sampler

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--pilot.Sampler
All Implemented Interfaces:
java.lang.Runnable

public class Sampler
extends java.lang.Thread


Field Summary
protected static JessCommunicator communicator_
          The interface with Jess
protected static java.util.Vector controls_
          This property defines the collection of controls
protected static int samplePeriod_
          The sample period defines the time between each sample
protected static Situations situations_
          The situations property points to the object that manages the situations of the application
protected static States states_
          The states property points to the object that manages the states of the application
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Sampler()
          The constructor initializes the controls and sets the sample period to the default value.
 
Method Summary
 void addControl(java.lang.String controlName, java.lang.String classname, java.lang.String type, java.util.Vector choices)
          The method addControl instantiates an object of the given control class and adds it to the collection of controls.
 JessCommunicator getCommunicator()
          The method getCommunicator returns the communicator with Jess.
 AbstractControl getControlByName(java.lang.String name)
          The method getControlByName returns the control which name is given.
 java.util.Vector getControls()
          The method getControls returns the vector with instantiated controls.
 Situations getSituations()
          The method getSituations returns the object that maintains the situations.
 States getStates()
          The method getStates returns the object that maintains the states.
 void run()
          The method run measures the controls every sample period.
 void setCommunicator(JessCommunicator communicator)
          The method setCommunicator defines the communicator with Jess.
 void setControls(java.util.Vector controls)
          The method setControl sets the method with controls.
 void setSituations(Situations situations)
          The method setSituations defines the object that maintains the situations.
 void setStates(States states)
          The method setStates defines the object that manages the states of the application.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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
 

Field Detail

states_

protected static States states_
The states property points to the object that manages the states of the application

situations_

protected static Situations situations_
The situations property points to the object that manages the situations of the application

controls_

protected static java.util.Vector controls_
This property defines the collection of controls

communicator_

protected static JessCommunicator communicator_
The interface with Jess

samplePeriod_

protected static int samplePeriod_
The sample period defines the time between each sample
Constructor Detail

Sampler

public Sampler()
The constructor initializes the controls and sets the sample period to the default value.
Method Detail

setStates

public void setStates(States states)
The method setStates defines the object that manages the states of the application.
Parameters:
states - The object that manages the states

getStates

public States getStates()
The method getStates returns the object that maintains the states.
Returns:
The states object.

setSituations

public void setSituations(Situations situations)
The method setSituations defines the object that maintains the situations.
Parameters:
situations - The situations object.

getSituations

public Situations getSituations()
The method getSituations returns the object that maintains the situations.
Returns:
The situations object

setControls

public void setControls(java.util.Vector controls)
The method setControl sets the method with controls.
Parameters:
controls - The vector with controls.

getControls

public java.util.Vector getControls()
The method getControls returns the vector with instantiated controls.
Returns:
Vector with controls.

getControlByName

public AbstractControl getControlByName(java.lang.String name)
The method getControlByName returns the control which name is given.
Parameters:
name - The name of the control
Returns:
The requested control

addControl

public void addControl(java.lang.String controlName,
                       java.lang.String classname,
                       java.lang.String type,
                       java.util.Vector choices)
The method addControl instantiates an object of the given control class and adds it to the collection of controls.
Parameters:
classname - The name of the control class

setCommunicator

public void setCommunicator(JessCommunicator communicator)
The method setCommunicator defines the communicator with Jess.
Parameters:
communicator - The Jess communicator.

getCommunicator

public JessCommunicator getCommunicator()
The method getCommunicator returns the communicator with Jess.
Returns:
The Jess communicator.

run

public void run()
The method run measures the controls every sample period.
Overrides:
run in class java.lang.Thread