|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.deepthought.sidious.greenhouse.SensorInput
@Immutable public final class SensorInput
This class represents a sensor input from the environment at a specific time.
It holds the id and the value of the given sensor at given time.
Field Summary | |
---|---|
private static org.apache.commons.logging.Log |
logger
Logger for this class |
private SuperLinkID |
superLinkID
The id of the sensor this represent. |
private double |
value
Current value of this sensor. |
Constructor Summary | |
---|---|
SensorInput(SuperLinkID superLinkID,
double value)
Creates a new SensorInput object from the specified
SuperLinkID and value . |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
boolean |
equalsOnSuperLinkID(SensorInput sensor)
Compares two sensor inputs on super link equality. |
SuperLinkID |
getID()
Returns the id of this sensor. |
double |
getValue()
Gets the value of this sensor. |
int |
hashCode()
Method hashes only on SuperLinkID |
SensorInput |
newInstanceWithNewValue(double value)
Creates a new instance of this type of SensorInput (i.e. |
private double |
round(double val)
Rounds the specified value. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log logger
private final SuperLinkID superLinkID
private final double value
Constructor Detail |
---|
public SensorInput(SuperLinkID superLinkID, double value)
SensorInput
object from the specified
SuperLinkID
and value
.
superLinkID
- the SuperLink Identifier of this sensorvalue
- value of this sensorMethod Detail |
---|
private double round(double val)
val
- the value to round
public SensorInput newInstanceWithNewValue(double value)
SensorInput
(i.e.
with the same id) with the specified new value
.
value
- the value of the new instance
SensorInput
public double getValue()
public boolean equalsOnSuperLinkID(SensorInput sensor)
Returns true
if and only if the SuperLinkID
specified sensor and this sensor are equal.
sensor
- the input sensor
true
if sensors have matching SuperLinkID'spublic SuperLinkID getID()
public int hashCode()
SuperLinkID
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |