java.lang.Object
com.wyu4.snowberryjam.compiler.data.tasks.RepeatTask
- All Implemented Interfaces:
ExecutableTask,BodiedTask,NamedTask,ValuedTask
A repeat loop, similar to a
for-loop. The number of times to iterate
is stored as SourceKey.VALUE, and the body to run on each iteration
is stored as SourceKey.BODY. An optional variable to set each
iteration can be stored as SourceKey.NAME.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BodyStackThe body to runprivate final ValueHolderThe number of times to repeat the loop.private final ValueHolderThe variable to set. -
Constructor Summary
ConstructorsConstructorDescriptionRepeatTask(com.fasterxml.jackson.databind.JsonNode node) Create a new repeat loop -
Method Summary
-
Field Details
-
repeats
The number of times to repeat the loop. Can be any type, so long as it has a size.- See Also:
-
variableName
The variable to set. Can be empty, so this is purely optional.- See Also:
-
body
The body to run
-
-
Constructor Details
-
RepeatTask
public RepeatTask(com.fasterxml.jackson.databind.JsonNode node) Create a new repeat loop- 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:
- Corresponding
SourceId
-
feedback
Description copied from interface:ExecutableTaskGet some feedback from the task. Can be anything, depending on the task.- Specified by:
feedbackin interfaceExecutableTask- Returns:
- null.
-
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
-
getName
-