public class Operation extends java.lang.Object implements CallableType, Saveable
Modifier and Type | Method and Description |
---|---|
static Operation |
create(TAMEOperation operation)
Creates an operation.
|
static Operation |
create(TAMEOperation operation,
Block conditionalBlock,
Block successBlock)
Creates an operation with a conditional and success block.
|
static Operation |
create(TAMEOperation operation,
Block conditionalBlock,
Block successBlock,
Block failureBlock)
Creates an operation with a conditional, success, and failure block.
|
static Operation |
create(TAMEOperation operation,
Block initializationBlock,
Block conditionalBlock,
Block stepBlock,
Block successBlock)
Creates a operation with an initializer, conditional, step, success, and failure block.
|
static Operation |
create(TAMEOperation operation,
Value operand0)
Creates an operation with an operand.
|
static Operation |
create(TAMEOperation operation,
Value operand0,
Value operand1)
Creates an operation with operands.
|
static Operation |
create(java.io.InputStream in)
Creates this object from an input stream, expecting its byte representation.
|
void |
execute(TAMERequest request,
TAMEResponse response,
ValueSet blockLocal)
Executes something that can change the request and response.
|
Block |
getConditionalBlock()
Gets the conditional assessment block, if any.
|
Block |
getFailureBlock()
Gets the failure control block, if any.
|
Block |
getInitBlock()
Gets the initializer block, if any.
|
Value |
getOperand0()
Gets the first operand, if any.
|
Value |
getOperand1()
Gets the second operand, if any.
|
TAMEOperation |
getOperation()
Gets the operation on this operation.
|
Block |
getStepBlock()
Gets the stepping control block, if any.
|
Block |
getSuccessBlock()
Gets the success control block, if any.
|
void |
readBytes(java.io.InputStream in)
Imports this object from bytes.
|
java.lang.String |
toString() |
void |
writeBytes(java.io.OutputStream out)
Exports this object to bytes.
|
public static Operation create(TAMEOperation operation)
operation
- the operation.public static Operation create(TAMEOperation operation, Value operand0)
operation
- the operation.operand0
- the first operand.public static Operation create(TAMEOperation operation, Value operand0, Value operand1)
operation
- the operation.operand0
- the first operand.operand1
- the second operand.public static Operation create(TAMEOperation operation, Block conditionalBlock, Block successBlock)
operation
- the operation.conditionalBlock
- the conditional block.successBlock
- the success block.public static Operation create(TAMEOperation operation, Block conditionalBlock, Block successBlock, Block failureBlock)
operation
- the operation.conditionalBlock
- the conditional block.successBlock
- the success block.failureBlock
- the failure block.public static Operation create(TAMEOperation operation, Block initializationBlock, Block conditionalBlock, Block stepBlock, Block successBlock)
operation
- the operation.initializationBlock
- the init block.conditionalBlock
- the conditional block.stepBlock
- the step block.successBlock
- the success block.public void execute(TAMERequest request, TAMEResponse response, ValueSet blockLocal) throws TAMEInterrupt
CallableType
execute
in interface CallableType
request
- the request object.response
- the response object.blockLocal
- the block local variable bank.TAMEInterrupt
- if an interrupt occurs.public TAMEOperation getOperation()
public Value getOperand0()
public Value getOperand1()
public Block getInitBlock()
public Block getConditionalBlock()
public Block getStepBlock()
public Block getSuccessBlock()
public Block getFailureBlock()
public java.lang.String toString()
toString
in class java.lang.Object
public static Operation create(java.io.InputStream in) throws java.io.IOException
in
- the input stream to read from.java.io.IOException
- if a read error occurs.public void writeBytes(java.io.OutputStream out) throws java.io.IOException
Saveable
writeBytes
in interface Saveable
out
- the output stream to write to.java.io.IOException
- if a write problem occurs.public void readBytes(java.io.InputStream in) throws java.io.IOException
Saveable