Class RecoverOperation
java.lang.Object
org.kigalisim.lang.operation.RecoverOperation
- All Implemented Interfaces:
Operation
Operation that recovers a percentage or amount of refrigerant.
This operation calculates a recovery amount and yield rate and applies it to the engine. It can optionally be limited to a specific time period using a ParsedDuring object.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum representing the stage of recovery. -
Constructor Summary
ConstructorsConstructorDescriptionRecoverOperation(Operation volumeOperation, Operation yieldOperation) Create a new RecoverOperation that applies to all years.RecoverOperation(Operation volumeOperation, Operation yieldOperation, Optional<Operation> inductionOperation) Create a new RecoverOperation that applies to all years with induction.RecoverOperation(Operation volumeOperation, Operation yieldOperation, RecoverOperation.RecoveryStage stage) Create a new RecoverOperation that applies to all years with stage.RecoverOperation(Operation volumeOperation, Operation yieldOperation, RecoverOperation.RecoveryStage stage, Optional<Operation> inductionOperation) Create a new RecoverOperation that applies to all years with stage and induction.RecoverOperation(Operation volumeOperation, Operation yieldOperation, ParsedDuring during) Create a new RecoverOperation that applies to a specific time period.RecoverOperation(Operation volumeOperation, Operation yieldOperation, ParsedDuring during, Optional<Operation> inductionOperation) Create a new RecoverOperation that applies to a specific time period with induction.RecoverOperation(Operation volumeOperation, Operation yieldOperation, ParsedDuring during, RecoverOperation.RecoveryStage stage) Create a new RecoverOperation that applies to a specific time period with stage.RecoverOperation(Operation volumeOperation, Operation yieldOperation, ParsedDuring during, RecoverOperation.RecoveryStage stage, Optional<Operation> inductionOperation) Create a new RecoverOperation that applies to a specific time period with stage and induction. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(PushDownMachine machine) Executes the recovery operation.getStage()Get the recovery stage.Get a record describing this operation's semantics.
-
Constructor Details
-
RecoverOperation
-
RecoverOperation
public RecoverOperation(Operation volumeOperation, Operation yieldOperation, RecoverOperation.RecoveryStage stage) Create a new RecoverOperation that applies to all years with stage.- Parameters:
volumeOperation- The operation that calculates the recovery amount.yieldOperation- The operation that calculates the yield rate.stage- The recovery stage (EOL or RECHARGE).
-
RecoverOperation
Create a new RecoverOperation that applies to a specific time period.- Parameters:
volumeOperation- The operation that calculates the recovery amount.yieldOperation- The operation that calculates the yield rate.during- The time period during which this operation applies.
-
RecoverOperation
public RecoverOperation(Operation volumeOperation, Operation yieldOperation, ParsedDuring during, RecoverOperation.RecoveryStage stage) Create a new RecoverOperation that applies to a specific time period with stage.- Parameters:
volumeOperation- The operation that calculates the recovery amount.yieldOperation- The operation that calculates the yield rate.during- The time period during which this operation applies.stage- The recovery stage (EOL or RECHARGE).
-
RecoverOperation
public RecoverOperation(Operation volumeOperation, Operation yieldOperation, Optional<Operation> inductionOperation) Create a new RecoverOperation that applies to all years with induction.- Parameters:
volumeOperation- The operation that calculates the recovery amount.yieldOperation- The operation that calculates the yield rate.inductionOperation- The operation that calculates the induction rate (Optional.empty() for default).
-
RecoverOperation
public RecoverOperation(Operation volumeOperation, Operation yieldOperation, RecoverOperation.RecoveryStage stage, Optional<Operation> inductionOperation) Create a new RecoverOperation that applies to all years with stage and induction.- Parameters:
volumeOperation- The operation that calculates the recovery amount.yieldOperation- The operation that calculates the yield rate.stage- The recovery stage (EOL or RECHARGE).inductionOperation- The operation that calculates the induction rate (Optional.empty() for default).
-
RecoverOperation
public RecoverOperation(Operation volumeOperation, Operation yieldOperation, ParsedDuring during, Optional<Operation> inductionOperation) Create a new RecoverOperation that applies to a specific time period with induction.- Parameters:
volumeOperation- The operation that calculates the recovery amount.yieldOperation- The operation that calculates the yield rate.during- The time period during which this operation applies.inductionOperation- The operation that calculates the induction rate (Optional.empty() for default).
-
RecoverOperation
public RecoverOperation(Operation volumeOperation, Operation yieldOperation, ParsedDuring during, RecoverOperation.RecoveryStage stage, Optional<Operation> inductionOperation) Create a new RecoverOperation that applies to a specific time period with stage and induction.- Parameters:
volumeOperation- The operation that calculates the recovery amount.yieldOperation- The operation that calculates the yield rate.during- The time period during which this operation applies.stage- The recovery stage (EOL or RECHARGE).inductionOperation- The operation that calculates the induction rate (Optional.empty() for default).
-
-
Method Details
-
getStage
Get the recovery stage.- Returns:
- The recovery stage (EOL or RECHARGE).
-
execute
Executes the recovery operation.This method performs the following steps:- Executes the volume operation to get the recovery amount
- Executes the yield operation to get the yield rate
- Handles the induction operation if present
- Builds the year matcher from the parsed during object
- Sets the induction rate on the engine
- Calls the recycle method on the engine
-
getStaticSemantics
Get a record describing this operation's semantics.Get a record describing this operation's semantics that are inferrable from its static expression in code. In other words, properties and effects which do not require inspection at time of executing the operation.
- Specified by:
getStaticSemanticsin interfaceOperation- Returns:
- Inference of common static properties found for this operation.
-