cat.sensor.util
Class Value

java.lang.Object
  extended bycat.sensor.util.Value

public class Value
extends java.lang.Object

This class represents a sensor data value object. A sensor data value may actually have two values such as GPS location.


Field Summary
private  Agent from
          The agent that the sensor data value is from.
private  boolean remote
          True if the sensor data value is from a remote sensor.
private  java.lang.Object secondary
          The secondary value of this sensor data value object.
private  java.lang.Object value
          The main value of this sensor data value object.
 
Constructor Summary
Value(java.lang.Object v)
          Construct a Value object with single local sensor data value.
Value(java.lang.Object v, Agent a, boolean r)
          Construct a Value object with single remote sensor data value.
Value(java.lang.Object v, java.lang.Object s)
          Construct a Value object with two local sensor data values.
Value(java.lang.Object v, java.lang.Object s, Agent a, boolean r)
          Construct a Value object with two remote sensor data values.
 
Method Summary
 Agent getAgent()
          Returns the agent who gave us the remote sensor data value.
 java.lang.Object getSecondaryValue()
          Returns the secondary value of this Sensor data value object.
 java.lang.Object getValue()
          Returns the main value of this Sensor data value object.
 boolean isRemote()
          Returns true if this value is from a remote sensor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

private java.lang.Object value
The main value of this sensor data value object.


secondary

private java.lang.Object secondary
The secondary value of this sensor data value object. (if it exists, otherwise null).


remote

private boolean remote
True if the sensor data value is from a remote sensor.


from

private Agent from
The agent that the sensor data value is from.

Constructor Detail

Value

public Value(java.lang.Object v)
Construct a Value object with single local sensor data value.

Parameters:
v - The value.

Value

public Value(java.lang.Object v,
             java.lang.Object s)
Construct a Value object with two local sensor data values.

Parameters:
v - The value.
s - The secondary value.

Value

public Value(java.lang.Object v,
             Agent a,
             boolean r)
Construct a Value object with single remote sensor data value.

Parameters:
v - The value.
a - The agent.
r - true if remote.

Value

public Value(java.lang.Object v,
             java.lang.Object s,
             Agent a,
             boolean r)
Construct a Value object with two remote sensor data values.

Parameters:
v - The value.
s - The secondary value.
a - The agent.
r - true if remote.
Method Detail

getValue

public java.lang.Object getValue()
Returns the main value of this Sensor data value object.

Returns:
Object The sensor data value object.

getSecondaryValue

public java.lang.Object getSecondaryValue()
Returns the secondary value of this Sensor data value object. Or null if none exists.

Returns:
Object The sensor data value object.

isRemote

public boolean isRemote()
Returns true if this value is from a remote sensor.

Returns:
boolean true if value is remote.

getAgent

public Agent getAgent()
Returns the agent who gave us the remote sensor data value. Or null if no agent exists.

Returns:
Agent The agent who gave the sensor data value.