Package org.kigalisim.lang.operation
Class ReplaceOperation
java.lang.Object
org.kigalisim.lang.operation.ReplaceOperation
- All Implemented Interfaces:
Operation
Operation that replaces a substance with another substance.
This operation calculates a replacement amount and applies it to the engine. It can optionally be limited to a specific time period using a ParsedDuring object.
-
Constructor Summary
ConstructorsConstructorDescriptionReplaceOperation(Operation amountOperation, String stream, String destinationSubstance) Create a new ReplaceOperation that applies to all years.ReplaceOperation(Operation amountOperation, String stream, String destinationSubstance, ParsedDuring during) Create a new ReplaceOperation that applies to a specific time period. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(PushDownMachine machine) Execute the calculation and leave the result at the top of the stack.
-
Constructor Details
-
ReplaceOperation
Create a new ReplaceOperation that applies to all years.- Parameters:
amountOperation- The operation that calculates the replacement amount.stream- The stream to replace.destinationSubstance- The substance to replace with.
-
ReplaceOperation
public ReplaceOperation(Operation amountOperation, String stream, String destinationSubstance, ParsedDuring during) Create a new ReplaceOperation that applies to a specific time period.- Parameters:
amountOperation- The operation that calculates the replacement amount.stream- The stream to replace.destinationSubstance- The substance to replace with.during- The time period during which this operation applies.
-
-
Method Details