java.lang.Object
com.wyu4.snowberryjam.compiler.data.tasks.WhileTask
- All Implemented Interfaces:
ExecutableTask,BodiedTask,ValuedTask
A while loop. The condition is stored as
SourceKey.VALUE. Runs
SourceKey.BODY while true.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BodyStackThe body to run while the condition is trueprivate final ValueHolderThe condition. -
Constructor Summary
ConstructorsConstructorDescriptionWhileTask(com.fasterxml.jackson.databind.JsonNode node) Create a new while loopWhileTask(ConditionalHolder condition, BodyStack body) Create a new while loop -
Method Summary
-
Field Details
-
condition
The condition. Must be of typeBoolean.- See Also:
-
body
The body to run while the condition is true
-
-
Constructor Details
-
WhileTask
public WhileTask(com.fasterxml.jackson.databind.JsonNode node) Create a new while loop- Parameters:
node- TheJsonNodeto refer
-
WhileTask
Create a new while loop- Parameters:
condition- The condition to check before runningbodybody- The body to run while the condition istrue
-
-
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.WHILE
-
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
-
getValue
- Specified by:
getValuein interfaceValuedTask
-