jhomenet.responsive
Class ValueCondition<T extends ValueSensor>

java.lang.Object
  extended by jhomenet.responsive.Condition<T>
      extended by jhomenet.responsive.SensorCondition<T>
          extended by jhomenet.responsive.ValueCondition<T>
All Implemented Interfaces:
ExpressionElement

public class ValueCondition<T extends ValueSensor>
extends SensorCondition<T>

Version:
$Revision: 1.16 $ Filename: $Source: /cvsroot/jhomenet/files/src/jhomenet/responsive/ValueCondition.java,v $ Description:
Author:
$Author: dhirwinjr $

Nested Class Summary
static class ValueCondition.ValueOperator
          Define the different operators.
 
Field Summary
 
Fields inherited from class jhomenet.responsive.SensorCondition
sensor
 
Fields inherited from class jhomenet.responsive.Condition
description, ID
 
Constructor Summary
ValueCondition()
          Default constructor.
 
Method Summary
 boolean equals(Condition testCondition)
          Test for equality between two conditions.
 boolean evaluateToBoolean()
          Evaluate the condition.
 java.util.ArrayList<java.lang.String> getOperators()
          Get a list of operators available for the condition.
 T getSensor()
          Get a reference to the condition's sensor object.
 boolean isSimple()
          Whether the expression element is simple.
 void setOperator(ValueCondition.ValueOperator operator)
          Set the test operator.
 void setSensor(T sensor)
          Set the condition's sensor object.
 void setTestValue(double testValue)
          Set the test value.
 java.lang.String toString()
          Get the string representation of the value condition.
 
Methods inherited from class jhomenet.responsive.Condition
evaluateToString, setDescription, setID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueCondition

public ValueCondition()
Default constructor.

Method Detail

setSensor

public void setSensor(T sensor)
Description copied from class: SensorCondition
Set the condition's sensor object.

Specified by:
setSensor in class SensorCondition<T extends ValueSensor>
See Also:
jhomenet.responsive.Condition#setSensor(Sensor)

getSensor

public T getSensor()
Description copied from class: SensorCondition
Get a reference to the condition's sensor object.

Specified by:
getSensor in class SensorCondition<T extends ValueSensor>
Returns:
A reference to the condition's sensor object
See Also:
jhomenet.responsive.Condition#getSensor()

setOperator

public void setOperator(ValueCondition.ValueOperator operator)
Set the test operator.

Parameters:
operator -

setTestValue

public void setTestValue(double testValue)
Set the test value.

Parameters:
testValue -

getOperators

public java.util.ArrayList<java.lang.String> getOperators()
Description copied from class: SensorCondition
Get a list of operators available for the condition.

Specified by:
getOperators in class SensorCondition<T extends ValueSensor>
Returns:
A list of operators
See Also:
jhomenet.responsive.Condition#getOperators()

toString

public java.lang.String toString()
Get the string representation of the value condition.

Specified by:
toString in class Condition<T extends ValueSensor>
See Also:
Object.toString()

equals

public boolean equals(Condition testCondition)
Description copied from class: Condition
Test for equality between two conditions.

Specified by:
equals in class Condition<T extends ValueSensor>
Returns:
Whether two conditions are equal
See Also:
Condition.equals(jhomenet.responsive.Condition)

evaluateToBoolean

public boolean evaluateToBoolean()
Description copied from class: Condition
Evaluate the condition.

Specified by:
evaluateToBoolean in class Condition<T extends ValueSensor>
Returns:
The boolean result
See Also:
Condition.evaluateToBoolean()

isSimple

public boolean isSimple()
Description copied from interface: ExpressionElement
Whether the expression element is simple.

Returns:
See Also:
ExpressionElement.isSimple()


Copyright © 2004-2005 David Irwin. All Rights Reserved.