Class MonitorNode

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

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

Data structure representing a single monitoring command.

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

Version:
0.2
Author:
Glenn Matthews

Field Summary
(package private)  int clientID
          The identifier of the monitoring app that asked for this information.
(package private)  double startTime
          The simulation time at which this monitoring command becomes relevant.
(package private)  double stopTime
          The simulation time after which this monitoring command becomes irrelevant and should be discarded.
(package private)  java.lang.String targetVar
          The identifier of the variable to be monitored.
 
Constructor Summary
MonitorNode(double start, double stop, java.lang.String target, int source)
          Basic constructor.
MonitorNode(int source, java.lang.String attribs)
          Simpler constructor that is more future-compatible - parses the given String to determine all parameters except clientID.
 
Method Summary
 int compareTo(MonitorNode o)
          Compares two MonitorNodes.
 boolean equals(java.lang.Object o)
          Checks for equality.
 int getClientID()
           
 double getStartTime()
           
 double getStopTime()
           
 java.lang.String getTargetVar()
           
 void setClientID(int i)
           
 void setStartTime(double t)
           
 void setStopTime(double t)
           
 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 monitoring command becomes relevant.


stopTime

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


targetVar

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


clientID

int clientID
The identifier of the monitoring app that asked for this information.

Constructor Detail

MonitorNode

public MonitorNode(double start,
                   double stop,
                   java.lang.String target,
                   int source)
Basic constructor.


MonitorNode

public MonitorNode(int source,
                   java.lang.String attribs)
Simpler constructor that is more future-compatible - parses the given String to determine all parameters except clientID.

Parameters:
source - Numeric identifier of the monitoring app making this request
attribs - String of the format "targetVar\r\nstartTime\r\nstopTime"
Method Detail

getStartTime

public double getStartTime()

getStopTime

public double getStopTime()

getTargetVar

public java.lang.String getTargetVar()

getClientID

public int getClientID()

setStartTime

public void setStartTime(double t)

setStopTime

public void setStopTime(double t)

setTargetVar

public void setTargetVar(java.lang.String s)

setClientID

public void setClientID(int i)

compareTo

public int compareTo(MonitorNode o)
Compares two MonitorNodes. Ordering is as follows:
  1. by startTime
  2. by stopTime
  3. by targetVar
  4. by clientID

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

equals

public boolean equals(java.lang.Object o)
Checks for equality. A MonitorNode is never equal to an Object that is not another MonitorNode; two MonitorNodes are equal if they have equal startTime, stopTime, targetVar, and clientID.

Overrides:
equals in class java.lang.Object