L
- the left argument type.R
- the right argument type.public final class ConditionalBinaryProcedure<L,R> extends Object implements BinaryProcedure<L,R>
BinaryProcedure
similiar to Java's "ternary"
or "conditional" operator (? :
).
Given a predicate
p and procedures
q and r, runs
if (p.test(x,y)) { q.run(x,y); } else { r.run(x,y); }
.Constructor and Description |
---|
ConditionalBinaryProcedure(BinaryPredicate<? super L,? super R> ifPred,
BinaryProcedure<? super L,? super R> thenProc)
Create a new ConditionalBinaryProcedure.
|
ConditionalBinaryProcedure(BinaryPredicate<? super L,? super R> ifPred,
BinaryProcedure<? super L,? super R> thenProc,
BinaryProcedure<? super L,? super R> elseProc)
Create a new ConditionalBinaryProcedure.
|
public ConditionalBinaryProcedure(BinaryPredicate<? super L,? super R> ifPred, BinaryProcedure<? super L,? super R> thenProc)
ifPred
- to evaluatethenProc
- if ifPred
yields true
public ConditionalBinaryProcedure(BinaryPredicate<? super L,? super R> ifPred, BinaryProcedure<? super L,? super R> thenProc, BinaryProcedure<? super L,? super R> elseProc)
ifPred
- to evaluatethenProc
- if ifPred
yields true
elseProc
- if ifPred
yields false
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.