|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.epochx.representation.Node<TYPE>
com.epochx.representation.FunctionNode<java.lang.Boolean>
com.epochx.representation.bool.IfFunction
public class IfFunction
A FunctionNode which represents the conditional if-then-else
statement.
| Constructor Summary | |
|---|---|
IfFunction()
Construct an IfFunction with no children. |
|
IfFunction(Node<java.lang.Boolean> condition,
Node<java.lang.Boolean> ifStatement,
Node<java.lang.Boolean> elseStatement)
Construct an IfFunction with three children. |
|
| Method Summary | |
|---|---|
java.lang.Boolean |
evaluate()
Evaluating an IfFunction involves evaluating the first child,
if it evaluates to true then the second child is evaluated as the result. |
java.lang.String |
getFunctionName()
Get the unique name that identifies this function. |
| Methods inherited from class com.epochx.representation.FunctionNode |
|---|
equals, toString |
| Methods inherited from class com.epochx.representation.Node |
|---|
clone, getArity, getChild, getChildren, getDepth, getFunctionNodes, getLength, getNodesAtDepth, getNoDistinctFunctions, getNoDistinctTerminals, getNoFunctions, getNoTerminals, getNthNode, getTerminalNodes, hashCode, setChild, setChildren, setNthNode |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IfFunction()
public IfFunction(Node<java.lang.Boolean> condition,
Node<java.lang.Boolean> ifStatement,
Node<java.lang.Boolean> elseStatement)
condition - The first child node.ifStatement - The second child node.elseStatement - The third child node.| Method Detail |
|---|
public java.lang.Boolean evaluate()
IfFunction involves evaluating the first child,
if it evaluates to true then the second child is evaluated as the result.
Otherwise the third child is evaluated and returned.
evaluate in class Node<java.lang.Boolean>public java.lang.String getFunctionName()
getFunctionName in class FunctionNode<java.lang.Boolean>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||