com.ptc.windchill.upgrade.util.fsm
Class And

java.lang.Object
  extended bycom.ptc.windchill.upgrade.util.fsm.And
All Implemented Interfaces:
Condition

public final class And
extends Object
implements Condition

A logical AND'ing condition. If you have two condition instances, an instance of this class will return true if both of them are true.

Behavior is short circuiting. So if the first condition is false, the second will not be evaluated.

Example

   Condition cond1 = new FirstCondition();
   Condition cond2 = new SecondCondition();
   Condition ored_cond = new And(cond1, cond2)

See Also:
Condition

Field Summary
private  Condition conditionA_
           
private  Condition conditionB_
           
private  Condition conditionC_
           
 
Fields inherited from interface com.ptc.windchill.upgrade.util.fsm.Condition
ALWAYS
 
Constructor Summary
And(Condition condition_a, Condition condition_b)
          Create an instance to logically AND the two provided conditions.
And(Condition condition_a, Condition condition_b, Condition condition_c)
           
 
Method Summary
 boolean evaluate(State state)
          True if both of the two wrapped conditions evaluate to true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conditionA_

private final Condition conditionA_

conditionB_

private final Condition conditionB_

conditionC_

private Condition conditionC_
Constructor Detail

And

public And(Condition condition_a,
           Condition condition_b)
Create an instance to logically AND the two provided conditions.


And

public And(Condition condition_a,
           Condition condition_b,
           Condition condition_c)
Method Detail

evaluate

public final boolean evaluate(State state)
                       throws Exception
True if both of the two wrapped conditions evaluate to true.

Specified by:
evaluate in interface Condition
Throws:
Exception