Enum FxSingleBarrierOptionMethod
- java.lang.Object
-
- java.lang.Enum<FxSingleBarrierOptionMethod>
-
- com.opengamma.strata.measure.fxopt.FxSingleBarrierOptionMethod
-
- All Implemented Interfaces:
CalculationParameter
,Named
,NamedEnum
,Serializable
,Comparable<FxSingleBarrierOptionMethod>
public enum FxSingleBarrierOptionMethod extends Enum<FxSingleBarrierOptionMethod> implements NamedEnum, CalculationParameter
The method to use for pricing FX single barrier options.This provides the ability to use different methods for pricing FX options. The Black and Trinomial-Tree methods are supported.
This enum implements
CalculationParameter
and is used by passing it as an argument toCalculationRules
. It provides the link between the data that the function needs and the data that is available inScenarioMarketData
.Implementations of this interface must be immutable.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BLACK
The Black (lognormal) model.TRINOMIAL_TREE
The Trinomial-Tree model.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<CalculationParameter>
filter(CalculationTarget target, Measure measure)
Filters this parameter to the specified target and measure.static FxSingleBarrierOptionMethod
of(String name)
Obtains an instance from the specified name.String
toString()
Returns the formatted name of the type.static FxSingleBarrierOptionMethod
valueOf(String name)
Returns the enum constant of this type with the specified name.static FxSingleBarrierOptionMethod[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Methods inherited from interface com.opengamma.strata.calc.runner.CalculationParameter
queryType
-
-
-
-
Enum Constant Detail
-
BLACK
public static final FxSingleBarrierOptionMethod BLACK
The Black (lognormal) model. This uses Black volatilities -BlackFxOptionVolatilities
.
-
TRINOMIAL_TREE
public static final FxSingleBarrierOptionMethod TRINOMIAL_TREE
The Trinomial-Tree model. This uses Black volatilities based on a smile -BlackFxOptionVolatilities
.
-
-
Method Detail
-
values
public static FxSingleBarrierOptionMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FxSingleBarrierOptionMethod c : FxSingleBarrierOptionMethod.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FxSingleBarrierOptionMethod valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
of
public static FxSingleBarrierOptionMethod of(String name)
Obtains an instance from the specified name.Parsing handles the mixed case form produced by
toString()
and the upper and lower case variants of the enum constant name.- Parameters:
name
- the name to parse- Returns:
- the type
- Throws:
IllegalArgumentException
- if the name is not known
-
filter
public Optional<CalculationParameter> filter(CalculationTarget target, Measure measure)
Description copied from interface:CalculationParameter
Filters this parameter to the specified target and measure.Parameters may apply to all targets and measures or just a subset. The
CalculationParameters.filter(CalculationTarget, Measure)
method uses this method to filter a complete set of parameters.By default, this returns
Optional.of(this)
. If the parameter does not apply to either the target or measure, then optional empty must be returned. If desired, the result can be a different parameter, allowing one parameter to delegate to another when filtered.- Specified by:
filter
in interfaceCalculationParameter
- Parameters:
target
- the calculation target, such as a trademeasure
- the measure to be calculated- Returns:
- the parameter appropriate to the target and measure, empty if this parameter does not apply
-
toString
public String toString()
Returns the formatted name of the type.- Overrides:
toString
in classEnum<FxSingleBarrierOptionMethod>
- Returns:
- the formatted string representing the type
-
-