net.sourceforge.wurfl.lang.twoparam
Class IfOp<V1,V2,R>
java.lang.Object
net.sourceforge.wurfl.lang.twoparam.TwoParamOp<V1,V2,R>
net.sourceforge.wurfl.lang.twoparam.IfOp<V1,V2,R>
public final class IfOp<V1,V2,R>
- extends TwoParamOp<V1,V2,R>
Construct an "if" operation that will execute its "else" body
if the supplied condition is false, and will otherwise execute
its regular body.
- Version:
- $Id$
|
Constructor Summary |
IfOp(Condition<V2> con,
TwoParamOp<V1,V2,R> body,
TwoParamOp<V1,V2,R> elseBody)
Construct an "if" operation that will execute its "else" body
if the supplied condition is false, and will otherwise execute
its regular body. |
|
Method Summary |
boolean |
equals(Object o)
Return true if the provided object equals this one. |
R |
execute(V1 v1,
V2 v2)
Execute this object's "else" body if this object's condition
evaluates to null; otherwise execute the main body. |
String |
getDescription()
|
logger
protected final org.slf4j.Logger logger
con
protected Condition<V2> con
body
protected TwoParamOp<V1,V2,R> body
elseBody
protected TwoParamOp<V1,V2,R> elseBody
IfOp
public IfOp(Condition<V2> con,
TwoParamOp<V1,V2,R> body,
TwoParamOp<V1,V2,R> elseBody)
- Construct an "if" operation that will execute its "else" body
if the supplied condition is false, and will otherwise execute
its regular body.
- Parameters:
con - the condition to eval to determine which body to
executebody - the body to execute if the condition is trueelseBody - the body to execute if the condition is false
equals
public boolean equals(Object o)
- Return true if the provided object equals this one.
Equality is tested only between condition and body, not elseBody.
- Overrides:
equals in class Object
- Returns:
- true if the provided object equals this one
execute
public R execute(V1 v1,
V2 v2)
- Execute this object's "else" body if this object's condition
evaluates to null; otherwise execute the main body.
- Specified by:
execute in class TwoParamOp<V1,V2,R>
getDescription
public String getDescription()
Copyright © 2012 ScientiaMobile Inc.. All Rights Reserved.