Class RechargeOperation

java.lang.Object
org.kigalisim.lang.operation.RechargeOperation
All Implemented Interfaces:
Operation

public class RechargeOperation extends Object implements Operation
Operation that services equipment with a specified volume and intensity.

This operation calculates a servicing volume and intensity and applies it to the engine. It can optionally be limited to a specific time period using a ParsedDuring object. The target parameter determines whether this operates on prior equipment (recharge) or new equipment (precharge).

  • Field Details

    • PRIOR

      public static final String PRIOR
      Target stream name for servicing existing (prior) equipment, producing a recharge.
      See Also:
    • NEW

      public static final String NEW
      Target stream name for servicing new equipment before sale, producing a precharge.
      See Also:
  • Constructor Details

    • RechargeOperation

      public RechargeOperation(Operation volumeOperation, Operation intensityOperation, Optional<ParsedDuring> duringMaybe, String target)
      Create a new RechargeOperation with explicit target and optional time period.
      Parameters:
      volumeOperation - The operation that calculates the servicing volume.
      intensityOperation - The operation that calculates the servicing intensity.
      duringMaybe - The optional time period during which this operation applies, or empty for all years.
      target - The target stream (PRIOR for recharge, NEW for precharge).
  • Method Details

    • execute

      public void execute(PushDownMachine machine)
      Execute the calculation and leave the result at the top of the stack.
      Specified by:
      execute in interface Operation
      Parameters:
      machine - The machine in which to execute the calculation if needed.
    • getStaticSemantics

      public OperationStaticSemantics 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:
      getStaticSemantics in interface Operation
      Returns:
      Inference of common static properties found for this operation.