jhomenet.responsive
Class Expression

java.lang.Object
  extended by jhomenet.responsive.Expression

public class Expression
extends java.lang.Object

Version:
$Revision: 1.16 $ Filename: $Source: /cvsroot/jhomenet/files/src/jhomenet/responsive/Expression.java,v $ Description: Comprised of a set of conditions. When executed, the result determines whether the sensor responsive plan will run or not.
Author:
$Author: dhirwinjr $

Nested Class Summary
static class Expression.OPERATORS
           
 
Constructor Summary
Expression()
          Default constructor.
 
Method Summary
 void _AND()
          Add an logical AND operator to the expression.
 void _CLOSE_PARENTHESIS()
          Add a closing parenthesis to the expression.
 void _NOT()
          Add a logical NOT operator to the expression.
 void _OPEN_PARENTHESIS()
          Add a open parenthesis to the expression.
 void _OR()
          Add a logical OR operator to the expression.
 void addCondition(Condition condition)
          Add a condition to the expression.
 boolean equals(Expression testExpression)
          Overridden equals method.
 java.lang.String getDescription()
          Get the expression description.
 java.util.LinkedList<ExpressionElement> getExpressionelements()
          Get the list of expression elements.
 java.lang.String getExpressionstring()
          Get the expression as a string.
 void setDescription(java.lang.String description)
          Set the expression description.
 void setExpressionstring(java.lang.String eString)
          Parse the passed expression string and create an expression.
 java.lang.String toString()
          Get a string representation of the expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Expression

public Expression()
Default constructor.

Method Detail

setDescription

public void setDescription(java.lang.String description)
Set the expression description.

Parameters:
description -

getDescription

public java.lang.String getDescription()
Get the expression description.

Returns:
Expression description

getExpressionelements

public java.util.LinkedList<ExpressionElement> getExpressionelements()
Get the list of expression elements.

Returns:
A list of expression elements

getExpressionstring

public java.lang.String getExpressionstring()
Get the expression as a string. This converts the expression elements into a single string representation.

Returns:
A string representation of the expression

setExpressionstring

public void setExpressionstring(java.lang.String eString)
Parse the passed expression string and create an expression.

Parameters:
eString -

addCondition

public void addCondition(Condition condition)
Add a condition to the expression.

Parameters:
condition - Condition to add to the expression

_OPEN_PARENTHESIS

public void _OPEN_PARENTHESIS()
Add a open parenthesis to the expression.


_CLOSE_PARENTHESIS

public void _CLOSE_PARENTHESIS()
Add a closing parenthesis to the expression.


_OR

public void _OR()
Add a logical OR operator to the expression.


_AND

public void _AND()
Add an logical AND operator to the expression.


_NOT

public void _NOT()
Add a logical NOT operator to the expression.


toString

public java.lang.String toString()
Get a string representation of the expression.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

equals

public boolean equals(Expression testExpression)
Overridden equals method. In order for the expressions to be deemed equal, they must have identical: 1) Ids 2)

Parameters:
testExpression -
Returns:
Whether the expressions are equal


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