Class
caplin.trading.derivation

DerivationManager

A Derivation manager manages multiple individual caplin.trading.derivation.Derivations. When an individual Derivation is performed (its recalculateDerivedFields() method is run) it extracts the appropriate values from the trade data that are required to perform the derivation and appends new derived values into that trading data object. The input to one Derivation may depend upon the output of another Derivation. When Derivations are added to the manager it examines these dependencies and when the #recalculateDerivedFields method is invoked ensures all derivations are executed in the correct order.

Constructor Summary

Attributes Name and Description
caplin.trading.derivation.DerivationManager()

Method Summary

Attributes Name and Description
void addDerivation(caplin.trading.derivation.Derivation oDerivation)

Adds a Derivation to be executed.

void recalculateDerivedFields(caplin.trading.trademodel.DataHolder oTradeDataHolder)

Recalculates the derived fields for all the derivations held within the DerivationManager, given the new trade data.

Constructor Detail

caplin.trading.derivation.DerivationManager()

Method Detail

void addDerivation(caplin.trading.derivation.Derivation oDerivation)

Adds a Derivation to be executed.

Parameters
caplin.trading.derivation.Derivation oDerivation The derivation to add.
Throws
caplin.core.Error
If the Derivation instance is not an instance of caplin.trading.derivation.Derivation.

void recalculateDerivedFields(caplin.trading.trademodel.DataHolder oTradeDataHolder)

Recalculates the derived fields for all the derivations held within the DerivationManager, given the new trade data.

Parameters
caplin.trading.trademodel.DataHolder oTradeDataHolder The data to be augmented by the set of managed Derivations.
Throws
caplin.core.Error
If the DataHolder instance is not an instance of caplin.trading.trademodel.DataHolder.