com.miginfocom.util.expression
Class XorExpression

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

public final class XorExpression
extends CompositeExpression

A composite expression that XOR:s the expressions and returns the result. I.e. returns true if the expressions return different results.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.miginfocom.util.expression.CompositeExpression
expression1, expression2
 
Constructor Summary
XorExpression(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

XorExpression

public XorExpression(Expression expression1,
                     Expression expression2)
Constructor.

Parameters:
expression1 - The first expression.
expression2 - The second expression.
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.