webcab.lib.finance.pricing.core.contexts
Class GenericTriggerContext
java.lang.Object
|
+--webcab.lib.finance.pricing.contexts.Context
|
+--webcab.lib.finance.pricing.core.contexts.GenericScalarContext
|
+--webcab.lib.finance.pricing.core.contexts.GenericTriggerContext
- All Implemented Interfaces:
- ScalarContext, ScalarContextRW, webcab.lib.finance.pricing.core.contexts.ScalarContextW, TriggerContext
- public class GenericTriggerContext
- extends GenericScalarContext
- implements TriggerContext
| Fields inherited from class webcab.lib.finance.pricing.contexts.Context |
ARITHMETIC_AVERAGE, contextGraph, FORWARD_RATE, FORWARD_RATE_VOLATILITY, GEOMETRIC_AVERAGE, LONG_RATE, MAX, MIN, MONEY_MARKET, MULTIFACTOR_FORWARD_RATE_VOLATILITY, NUMERAIRE, PRICE, SCALAR, SPOT_RATE, TRIGGER, VOID, VOLATILITY |
| Methods inherited from class webcab.lib.finance.pricing.contexts.Context |
applyDeltaContext, findAppliableContextNamed, findAppliableContextOfIndex, findAppliableContextOfType, findDependentContextNamed, findDependentContextOfIndex, findDependentContextOfType, getBaseIndex, getGlobalIndexesForVariablesOnWhichContextFunctionsDepend, getMemoryVariable, getName, getNMemoryVariables, getNVariables, getTypeName, getTypeNameOfIndex, getTypeNames, getUpdatedMemoryVariables, getVariable, hasMemory, hasType, memoryNotRecovered, setMemoryVariable, setMemoryVariables, setName, setVariable, toString |
GenericTriggerContext
public GenericTriggerContext(String contextName,
double value)
GenericTriggerContext
public GenericTriggerContext(GenericTriggerContext genericTriggerContext)
packValue
public static double packValue(boolean triggerState,
double additionalInfo)
extractAdditionalInfo
public static double extractAdditionalInfo(double packedValue)
extractTriggerState
public static boolean extractTriggerState(double packedValue)
getAdditionalInfo
public double getAdditionalInfo()
- Description copied from interface:
TriggerContext
- Retrieves the additional info encoded in the trigger.
In case you use
TriggerModel this information is
the time spent with the trigger on (either continuous (PARISIAN) or
total (PARASIAN).
- Specified by:
getAdditionalInfo in interface TriggerContext
- Returns:
- double
isTriggered
public boolean isTriggered()
- Description copied from interface:
TriggerContext
- Retrieves the state of the trigger
- Specified by:
isTriggered in interface TriggerContext
- Returns:
- boolean
getPackedValue
public double getPackedValue()
- Description copied from interface:
TriggerContext
- Returns the encoded trigger value (state + additional info).
- Specified by:
getPackedValue in interface TriggerContext
- Returns:
- double
getTypes
public int[] getTypes()
- Description copied from class:
Context
- Returns all the categories supported by this node
- Overrides:
getTypes in class GenericScalarContext
getLocalIndexesForVariablesOnWhichContextFunctionsDepend
public int[] getLocalIndexesForVariablesOnWhichContextFunctionsDepend(int type)
throws BondsException
- Overrides:
getLocalIndexesForVariablesOnWhichContextFunctionsDepend in class GenericScalarContext
BondsException
clone
public Object clone()
- Overrides:
clone in class GenericScalarContext