pilot
Class States

java.lang.Object
  |
  +--pilot.States
All Implemented Interfaces:
StatesAndSituations

public class States
extends java.lang.Object
implements StatesAndSituations


Field Summary
protected  int currentIndex_
          Because of the sliding window of states visible, this property is needed to pinpoint the index of the current state.
protected  java.util.Vector names_
          This vector contains the names of the controls.
protected  java.util.Vector[] variableValues_
          This array of vectors maintains the values of the control of the states.
protected  int windowSize_
          The window size sets the number of past states that are maintained.
 
Constructor Summary
States()
          This constructor sets the default window size and initiates the properties of this class.
States(int ws)
          This constructor sets a specific window size and initiates the properties of this class.
 
Method Summary
 void addName(java.lang.String name)
          The method addName adds a new control to the list of control names.
 void addVariableValues(java.util.Vector state)
          The method addVariableValue appends a state vector to the window of states.
 int getCurrentIndex()
          The method getCurrentIndex returns the index of the current state.
 java.util.Vector getLastVariableValues()
          This method returns the last, the current, state vector.
 java.util.Vector getNames()
          The method getNames returns a vector with the control names.
 java.lang.String getValueOf(java.lang.String controlName)
          The method getValueOf returns the value of a control.
 java.util.Vector[] getVariableValues()
          This method getVariableValues returns the complete array of state vectors.
 java.util.Vector getVariableValues(int index)
          This method getVariableValues returns a specific state in the array of states.
 int getWindowSize()
          The method getWindowSize returns the value of the window size of this class.
 void setCurrentIndex(int index)
          The method setCurrentIndex sets the index that determines the current state.
 void setNames(java.util.Vector names)
          The method setNames sets the vector of control names.
 void setVariableValues(int index, java.util.Vector state)
          This method setVariableValues sets one state vector in the array of states.
 void setVariableValues(java.util.Vector[] states)
          This method setVariableValues sets the complete array of state vectors.
 void setWindowSize(int ws)
          The method setWindowSize sets the value of the property windowSize_.
 int size()
          The method size returns the number of controls that are maintained by an object of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

windowSize_

protected int windowSize_
The window size sets the number of past states that are maintained.

names_

protected java.util.Vector names_
This vector contains the names of the controls.

variableValues_

protected java.util.Vector[] variableValues_
This array of vectors maintains the values of the control of the states. Each entry in the array represents a state, that is a vector of control values.

currentIndex_

protected int currentIndex_
Because of the sliding window of states visible, this property is needed to pinpoint the index of the current state.
Constructor Detail

States

public States()
This constructor sets the default window size and initiates the properties of this class.

States

public States(int ws)
This constructor sets a specific window size and initiates the properties of this class.
Parameters:
ws - The value of the desired window size
Method Detail

setWindowSize

public void setWindowSize(int ws)
The method setWindowSize sets the value of the property windowSize_.
Specified by:
setWindowSize in interface StatesAndSituations
Parameters:
ws - The value of the desired window size

getWindowSize

public int getWindowSize()
The method getWindowSize returns the value of the window size of this class.
Specified by:
getWindowSize in interface StatesAndSituations
Returns:
The value of the window size.

setNames

public void setNames(java.util.Vector names)
The method setNames sets the vector of control names.
Specified by:
setNames in interface StatesAndSituations
Parameters:
names - The vector with control names.

getNames

public java.util.Vector getNames()
The method getNames returns a vector with the control names.
Specified by:
getNames in interface StatesAndSituations
Returns:
The vector with the control names.

addName

public void addName(java.lang.String name)
The method addName adds a new control to the list of control names.
Specified by:
addName in interface StatesAndSituations
Parameters:
name - The name of the control

setVariableValues

public void setVariableValues(java.util.Vector[] states)
This method setVariableValues sets the complete array of state vectors.
Parameters:
states - The array of values for the state vectors.

setVariableValues

public void setVariableValues(int index,
                              java.util.Vector state)
This method setVariableValues sets one state vector in the array of states.
Parameters:
index - The index of the state.
state - The state vector with the values of the controls.

getVariableValues

public java.util.Vector[] getVariableValues()
This method getVariableValues returns the complete array of state vectors.
Returns:
The array of state vectors.

getVariableValues

public java.util.Vector getVariableValues(int index)
This method getVariableValues returns a specific state in the array of states.
Parameters:
index - The index value of the requested state.
Returns:
The requested state vector.

addVariableValues

public void addVariableValues(java.util.Vector state)
The method addVariableValue appends a state vector to the window of states.
Parameters:
state - The state vector with control values.

getLastVariableValues

public java.util.Vector getLastVariableValues()
This method returns the last, the current, state vector.
Returns:
The current state vector.

setCurrentIndex

public void setCurrentIndex(int index)
The method setCurrentIndex sets the index that determines the current state.
Parameters:
index - The index of the current state.

getCurrentIndex

public int getCurrentIndex()
The method getCurrentIndex returns the index of the current state.
Returns:
The index of the current state.

size

public int size()
The method size returns the number of controls that are maintained by an object of this class.
Specified by:
size in interface StatesAndSituations
Returns:
The number of controls maintained.

getValueOf

public java.lang.String getValueOf(java.lang.String controlName)
The method getValueOf returns the value of a control.
Parameters:
controlName - The name of the control
Returns:
The value of the control