Package org.kigalisim.engine.support
Class ImplicitRechargeUpdate
java.lang.Object
org.kigalisim.engine.support.ImplicitRechargeUpdate
Immutable result of implicit recharge/precharge calculation.
This class encapsulates the result of calculating and applying implicit recharge and precharge to a stream value. For sales streams with equipment units, it contains both the adjusted value (original value plus recharge and precharge) and state updates for the implicitRecharge and implicitPrecharge streams. For other streams, it contains the original value unchanged with empty state updates.
-
Constructor Summary
ConstructorsConstructorDescriptionImplicitRechargeUpdate(EngineNumber valueToSet, Optional<SimulationStateUpdate> implicitRechargeStateUpdate) Creates a new ImplicitRechargeUpdate with the specified values.ImplicitRechargeUpdate(EngineNumber valueToSet, Optional<SimulationStateUpdate> implicitRechargeStateUpdate, Optional<SimulationStateUpdate> implicitPrechargeStateUpdate) Creates a new ImplicitRechargeUpdate with recharge and precharge state updates. -
Method Summary
Modifier and TypeMethodDescriptionGets the optional state update for the implicitPrecharge stream.Gets the optional state update for the implicitRecharge stream.Gets the adjusted value to set for the stream.
-
Constructor Details
-
ImplicitRechargeUpdate
public ImplicitRechargeUpdate(EngineNumber valueToSet, Optional<SimulationStateUpdate> implicitRechargeStateUpdate) Creates a new ImplicitRechargeUpdate with the specified values.- Parameters:
valueToSet- The adjusted value to set for the stream (with recharge added if applicable)implicitRechargeStateUpdate- Optional state update for the implicitRecharge stream
-
ImplicitRechargeUpdate
public ImplicitRechargeUpdate(EngineNumber valueToSet, Optional<SimulationStateUpdate> implicitRechargeStateUpdate, Optional<SimulationStateUpdate> implicitPrechargeStateUpdate) Creates a new ImplicitRechargeUpdate with recharge and precharge state updates.- Parameters:
valueToSet- The adjusted value to set for the stream (with recharge and precharge added)implicitRechargeStateUpdate- Optional state update for the implicitRecharge streamimplicitPrechargeStateUpdate- Optional state update for the implicitPrecharge stream
-
-
Method Details
-
getValueToSet
Gets the adjusted value to set for the stream.For sales streams with equipment units, this is the original value plus the calculated recharge and precharge volumes. For other streams, this is the original value unchanged.
- Returns:
- The value to set for the stream
-
getImplicitRechargeStateUpdate
Gets the optional state update for the implicitRecharge stream.- Returns:
- Optional state update for the implicitRecharge stream
-
getImplicitPrechargeStateUpdate
Gets the optional state update for the implicitPrecharge stream.- Returns:
- Optional state update for the implicitPrecharge stream
-