com.miginfocom.util.expression
Class AndExpression

java.lang.Object
  extended by com.miginfocom.util.expression.CompositeExpression
      extended by com.miginfocom.util.expression.AndExpression
All Implemented Interfaces:
Expression, java.io.Serializable

public final class AndExpression
extends CompositeExpression

A composite expression that AND:s the expressions and returns the result.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.miginfocom.util.expression.CompositeExpression
expression1, expression2
 
Constructor Summary
AndExpression(Expression expression1, Expression expression2)
          Constructor.
 
Method Summary
 boolean evaluate(PropertyProvider provider)
          Returns whether the expression validates to true.
 
Methods inherited from class com.miginfocom.util.expression.CompositeExpression
equals, getExpression1, getExpression2
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndExpression

public AndExpression(Expression expression1,
                     Expression expression2)
Constructor.

Parameters:
expression1 - The first expression.
expression2 - The second expression. Only evaluated if expression1 is true.
Method Detail

evaluate

public boolean evaluate(PropertyProvider provider)
Description copied from interface: Expression
Returns whether the expression validates to true.

Parameters:
provider - The object that is to give the value for the property name. It's PropertyProvider.getProperty(com.miginfocom.util.PropertyKey) will be called with propName.

Note! This "callback" object is only in a valid state to get the property during this method call.

Subclasses may disregard this object altogether to have some arbitrary evaluation logic.

Returns:
If the propNameValue evaluates to true depending on operation and propValue.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.