jhomenet.commons.responsive.condition
Class ValueCondition

java.lang.Object
  extended by jhomenet.commons.responsive.condition.AbstractCondition
      extended by jhomenet.commons.responsive.condition.SensorCondition<ValueSensor>
          extended by jhomenet.commons.responsive.condition.ValueCondition
All Implemented Interfaces:
java.io.Serializable, Condition, ExpressionComponent

public class ValueCondition
extends SensorCondition<ValueSensor>

An interface defining a sensor responsive value condition.

Id: $Id: $

Author:
Dave Irwin (jhomenet at gmail dot com)
See Also:
Serialized Form

Constructor Summary
ValueCondition(java.lang.String conditionName, ValueSensor valueSensor, java.lang.Integer ioChannel, ValueConditionOperator testOperator, ValueData testValue)
          Constructor.
ValueCondition(java.lang.String conditionName, ValueSensor valueSensor, ValueConditionOperator testOperator, ValueData testValue)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Boolean evaluate()
          Evaluation the condition.
 ValueConditionOperator getTestOperator()
           
 ValueData getTestValue()
           
 int hashCode()
           
 void setTestOperator(ValueConditionOperator testOperator)
          Set the test operator.
 void setTestValue(ValueData testValue)
          Set the test value.
 
Methods inherited from class jhomenet.commons.responsive.condition.SensorCondition
getChannel, getHardwareAddr, getSensor, setSensor
 
Methods inherited from class jhomenet.commons.responsive.condition.AbstractCondition
evaluateToString, getConditionName, getId, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueCondition

public ValueCondition(java.lang.String conditionName,
                      ValueSensor valueSensor,
                      java.lang.Integer ioChannel,
                      ValueConditionOperator testOperator,
                      ValueData testValue)
Constructor.

Parameters:
conditionName - Condition name
valueSensor - Reference to the value sensor
ioChannel - The I/O channel
testOperator - The test operator
testValue - The test value

ValueCondition

public ValueCondition(java.lang.String conditionName,
                      ValueSensor valueSensor,
                      ValueConditionOperator testOperator,
                      ValueData testValue)
Constructor.

Parameters:
conditionName - Condition name
valueSensor - Reference to the value sensor
testOperator - The test operator
testValue - The test value
Method Detail

setTestOperator

public final void setTestOperator(ValueConditionOperator testOperator)
Set the test operator.

Parameters:
testOperator -

getTestOperator

public final ValueConditionOperator getTestOperator()
Returns:

setTestValue

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

Parameters:
testValue -

getTestValue

public final ValueData getTestValue()
Returns:

evaluate

public java.lang.Boolean evaluate()
                           throws ResponsiveException
Description copied from interface: Condition
Evaluation the condition.

Returns:
Boolean.TRUE if the condition is true, Boolean.FALSE otherwise
Throws:
ResponsiveException
See Also:
Condition.evaluate()

hashCode

public int hashCode()
Specified by:
hashCode in interface Condition
Overrides:
hashCode in class SensorCondition<ValueSensor>
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface Condition
Overrides:
equals in class SensorCondition<ValueSensor>
See Also:
Object.equals(java.lang.Object)


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