public final class ConditionalNullaryProcedure extends Object implements NullaryProcedure
NullaryProcedure
similiar to Java's "ternary"
or "conditional" operator (? :
).
Given a predicate
p and procedures
q and r, runs
if (p.test()) { q.run(); } else { r.run(); }
.Constructor and Description |
---|
ConditionalNullaryProcedure(NullaryPredicate ifPred,
NullaryProcedure thenProc)
Create a new ConditionalNullaryProcedure.
|
ConditionalNullaryProcedure(NullaryPredicate ifPred,
NullaryProcedure thenProc,
NullaryProcedure elseProc)
Create a new ConditionalNullaryProcedure.
|
public ConditionalNullaryProcedure(NullaryPredicate ifPred, NullaryProcedure thenProc)
ifPred
- ifthenProc
- thenpublic ConditionalNullaryProcedure(NullaryPredicate ifPred, NullaryProcedure thenProc, NullaryProcedure elseProc)
ifPred
- ifthenProc
- thenelseProc
- elsepublic void run()
run
in interface Runnable
run
in interface NullaryProcedure
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.