Class SteerNode

java.lang.Object
  extended by SteerNode
All Implemented Interfaces:
java.lang.Comparable<SteerNode>

public class SteerNode
extends java.lang.Object
implements java.lang.Comparable<SteerNode>

Data structure representing a single steering command.

This version only supports ongoing steering, not recurring steering. To perform one-time-only steering, set startTime = stopTime.

This version only supports fixed-value steering (set X = 3), nothing fancier (set X = X+1 or set X = Y) yet.

Version:
0.2
Author:
Glenn Matthews

Field Summary
(package private)  int clientID
          The identifier of the steering app that asked for this control.
(package private)  java.lang.String setPoint
          The value to which the variable should be set.
(package private)  double startTime
          The simulation time at which this steering command becomes relevant.
(package private)  double stopTime
          The simulation time after which this steering command becomes irrelevant and should be discarded.
(package private)  java.lang.String targetVar
          The identifier of the variable to be steered.
 
Constructor Summary
SteerNode(double start, double stop, java.lang.String target, java.lang.String set, int client)
          Basic constructor.
SteerNode(int client, java.lang.String attribs)
          More future-compatible constructor.
 
Method Summary
 int compareTo(SteerNode o)
          Compares two SteerNodes.
 boolean equals(java.lang.Object o)
          Checks for equality.
 int getClientID()
           
 java.lang.String getSetPoint()
           
 double getStartTime()
           
 double getStopTime()
           
 java.lang.String getTargetVar()
           
 void setClientID(int i)
           
 void setSetPoint(java.lang.String s)
           
 void setStartTime(double d)
           
 void setStopTime(double d)
           
 void setTargetVar(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startTime

double startTime
The simulation time at which this steering command becomes relevant.


stopTime

double stopTime
The simulation time after which this steering command becomes irrelevant and should be discarded.


targetVar

java.lang.String targetVar
The identifier of the variable to be steered.


setPoint

java.lang.String setPoint
The value to which the variable should be set.


clientID

int clientID
The identifier of the steering app that asked for this control.

Constructor Detail

SteerNode

public SteerNode(double start,
                 double stop,
                 java.lang.String target,
                 java.lang.String set,
                 int client)
Basic constructor.


SteerNode

public SteerNode(int client,
                 java.lang.String attribs)
More future-compatible constructor. Parses a String to determine parameters

Parameters:
client - Identifier of the client app making this request.
attribs - String of the format "targetVar\r\nsetPoint\r\nstartTime\r\nstopTime"
Method Detail

getClientID

public int getClientID()

getStartTime

public double getStartTime()

getStopTime

public double getStopTime()

getTargetVar

public java.lang.String getTargetVar()

getSetPoint

public java.lang.String getSetPoint()

setClientID

public void setClientID(int i)

setStartTime

public void setStartTime(double d)

setStopTime

public void setStopTime(double d)

setTargetVar

public void setTargetVar(java.lang.String s)

setSetPoint

public void setSetPoint(java.lang.String s)

compareTo

public int compareTo(SteerNode o)
Compares two SteerNodes. Ordering is as follows:
  1. by startTime
  2. by stopTime
  3. by targetVar
  4. by clientID
setPoint is not compared; if all other params are equal, the two SteerNodes are in direct conflict, and so should be considered equal!

Specified by:
compareTo in interface java.lang.Comparable<SteerNode>

equals

public boolean equals(java.lang.Object o)
Checks for equality. A SteerNode is never equal to an Object that is not another SteerNode; two SteerNodes are equal if they have equal startTime, stopTime, targetVar, and clientID. Note that two SteerNodes that have different setPoint values but are otherwise identical are still considered equal!

Overrides:
equals in class java.lang.Object