java.lang.Object
com.wyu4.snowberryjam.compiler.data.tasks.IfElseTask
- All Implemented Interfaces:
ExecutableTask,BodiedTask,ElseBodiedTask,ValuedTask
public class IfElseTask
extends Object
implements ExecutableTask, BodiedTask, ElseBodiedTask, ValuedTask
An if-else statement. The condition is stored as
SourceKey.VALUE. Runs SourceKey.BODY if true, else SourceKey.ELSE.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIfElseTask(com.fasterxml.jackson.databind.JsonNode node) Create a new if-else statement -
Method Summary
-
Field Details
-
condition
The condition. Must be of typeBoolean.- See Also:
-
body
The body to run if the condition is true -
elseBody
The body to run if the condition is false
-
-
Constructor Details
-
IfElseTask
public IfElseTask(com.fasterxml.jackson.databind.JsonNode node) Create a new if-else statement- Parameters:
node- TheJsonNodeto refer
-
-
Method Details
-
execute
public void execute()Description copied from interface:ExecutableTaskRun the task- Specified by:
executein interfaceExecutableTask
-
getId
Description copied from interface:ExecutableTaskGet the ID of the task- Specified by:
getIdin interfaceExecutableTask- Returns:
SourceId.IF_ELSE
-
feedback
Description copied from interface:ExecutableTaskGet some feedback from the task. Can be anything, depending on the task.- Specified by:
feedbackin interfaceExecutableTask- Returns:
- The current state of the condition.
-
toString
-
getBody
Description copied from interface:BodiedTaskGet the stack of this task- Specified by:
getBodyin interfaceBodiedTask- Returns:
BodyStackof this task
-
getSecondaryBody
Description copied from interface:ElseBodiedTaskGet the second stack of this task- Specified by:
getSecondaryBodyin interfaceElseBodiedTask- Returns:
- Second
BodyStackof this task
-
getValue
- Specified by:
getValuein interfaceValuedTask
-