net.sourceforge.wurfl.lang.oneparam
Class IfOp<V,R>
java.lang.Object
net.sourceforge.wurfl.lang.twoparam.TwoParamOp<V,Curry,R>
net.sourceforge.wurfl.lang.oneparam.OneParamOp<V,R>
net.sourceforge.wurfl.lang.oneparam.IfOp<V,R>
public final class IfOp<V,R>
- extends OneParamOp<V,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$
| Fields inherited from class net.sourceforge.wurfl.lang.twoparam.TwoParamOp |
logger |
|
Constructor Summary |
IfOp(Condition<V> con,
OneParamOp<V,R> body,
OneParamOp<V,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(V str)
Execute this object's "else" body if this object's condition
evaluates to null; otherwise execute the main body. |
String |
getDescription()
|
con
protected Condition con
body
protected OneParamOp<V,R> body
elseBody
protected OneParamOp<V,R> elseBody
IfOp
public IfOp(Condition<V> con,
OneParamOp<V,R> body,
OneParamOp<V,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(V str)
- Execute this object's "else" body if this object's condition
evaluates to null; otherwise execute the main body.
- Specified by:
execute in class OneParamOp<V,R>
getDescription
public String getDescription()
Copyright © 2012 ScientiaMobile Inc.. All Rights Reserved.