public final class Task
extends Object
Program
to compute a value from a result's inputs.Modifier and Type | Class and Description |
---|---|
static class |
Task.Context
Task context.
|
static class |
Task.ExecuteException
Execute Exception.
|
Constructor and Description |
---|
Task(Task.Context context)
Constructs an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
call(Program program)
Calls a program.
|
void |
end()
Ends this task.
|
Optional<PointValue> |
execute(Program program)
Executes the program to compute a result value.
|
Optional<Container> |
getContainer()
Gets the container.
|
Task.Context |
getContext()
Gets the context.
|
boolean |
getFailReturnsNull()
Gets the 'FailReturnsNull' indicator.
|
Optional<PointValue> |
getInput(Integer index)
Gets a numbered input.
|
Integer |
getInputCount()
Gets the input count.
|
Serializable[] |
getInputs()
Get the input values.
|
Serializable |
getMemory(Integer index)
Gets a numbered memory value.
|
Optional<? extends PointValue> |
getNormalizedInput(Integer index)
Gets a normalized numbered input.
|
Optional<String> |
getParam(Integer index)
Gets a numbered parameter value.
|
Optional<Point> |
getResultPoint()
Gets the result point.
|
Stack |
getStack()
Gets the task's stack.
|
void |
markChangedStack(Stack stack)
Informs that the mark has changed.
|
Optional<OperationReference> |
nextReference()
Returns the next operation reference from code.
|
void |
setContainer(Optional<Container> container)
Sets the container.
|
void |
setInput(Integer index,
Serializable value)
Sets a numbered input value.
|
void |
setMemory(Integer index,
Serializable value)
Sets a numbered memory value.
|
public Task(@Nonnull Task.Context context)
context
- The context.public void call(@Nonnull Program program) throws Task.ExecuteException
program
- The program.Task.ExecuteException
- When appropriate.public void end()
@Nonnull @CheckReturnValue public Optional<PointValue> execute(@Nonnull Program program)
program
- The program.@Nonnull @CheckReturnValue public Optional<Container> getContainer()
@Nonnull @CheckReturnValue public Task.Context getContext()
@CheckReturnValue public boolean getFailReturnsNull()
@Nonnull @CheckReturnValue public Optional<PointValue> getInput(@Nonnull Integer index)
index
- An origin one index identifying the input.@Nonnull @CheckReturnValue public Integer getInputCount()
@Nonnull @CheckReturnValue public Serializable[] getInputs()
@Nullable @CheckReturnValue public Serializable getMemory(@Nonnull Integer index)
index
- An origin one index identifying the memory value.@Nonnull @CheckReturnValue public Optional<? extends PointValue> getNormalizedInput(@Nonnull Integer index)
index
- An origin one index identifying the input.@Nonnull @CheckReturnValue public Optional<String> getParam(@Nonnull Integer index)
index
- An origin one index identifying the parameter value.@Nonnull @CheckReturnValue public Optional<Point> getResultPoint()
@Nonnull @CheckReturnValue public Stack getStack()
public void markChangedStack(@Nonnull Stack stack)
stack
- The new mark.@Nonnull @CheckReturnValue public Optional<OperationReference> nextReference()
The virtual program counter is advanced.
public void setContainer(@Nonnull Optional<Container> container)
container
- The optional container.public void setInput(@Nonnull Integer index, @Nullable Serializable value)
index
- An origin one index identifying the input value.value
- A serializable object to use as the value.public void setMemory(@Nonnull Integer index, @Nullable Serializable value)
index
- An origin one index identifying the memory value.value
- A serializable object to use as the value.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.