WebCab Bonds
v2.01
(J2SE Edition)

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


Field Summary
 
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
 
Constructor Summary
GenericTriggerContext(GenericTriggerContext genericTriggerContext)
           
GenericTriggerContext(String contextName, double value)
           
 
Method Summary
 Object clone()
           
static double extractAdditionalInfo(double packedValue)
           
static boolean extractTriggerState(double packedValue)
           
 double getAdditionalInfo()
          Retrieves the additional info encoded in the trigger.
 int[] getLocalIndexesForVariablesOnWhichContextFunctionsDepend(int type)
           
 double getPackedValue()
          Returns the encoded trigger value (state + additional info).
 int[] getTypes()
          Returns all the categories supported by this node
 boolean isTriggered()
          Retrieves the state of the trigger
static double packValue(boolean triggerState, double additionalInfo)
           
 
Methods inherited from class webcab.lib.finance.pricing.core.contexts.GenericScalarContext
getValue, getValueIndex, setValue
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericTriggerContext

public GenericTriggerContext(String contextName,
                             double value)

GenericTriggerContext

public GenericTriggerContext(GenericTriggerContext genericTriggerContext)
Method Detail

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

WebCab Bonds
v2.01
(J2SE Edition)