Class CalculationRules
- java.lang.Object
-
- com.opengamma.strata.calc.CalculationRules
-
- All Implemented Interfaces:
org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class CalculationRules extends Object implements org.joda.beans.ImmutableBean
A set of rules that define how the calculation runner should perform calculations.CalculationRunner
provides the ability to perform calculations on many targets, such as trades and positions. It returns a grid of results, with the targets as rows. Each individual calculation is controlled by three things:- The function, selected by the target type
- The measure, the high-level output to be calculated
- The parameters, adjust how the measure is to be calculated
CalculationRules
operates in association withColumn
. The column is used to define the measure. It can also be used to specify column-specific parameters. The rules contain the complete set of functions and the default set of parameters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CalculationRules.Meta
The meta-bean forCalculationRules
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
CalculationFunctions
getFunctions()
Gets the calculation functions.CalculationParameters
getParameters()
Gets the calculation parameters, used to control the how the calculation is performed.ReportingCurrency
getReportingCurrency()
Gets the reporting currency, used to control currency conversion.int
hashCode()
static CalculationRules.Meta
meta()
The meta-bean forCalculationRules
.CalculationRules.Meta
metaBean()
static CalculationRules
of(CalculationFunctions functions, Currency reportingCurrency, CalculationParameter... parameters)
Obtains an instance specifying the functions, reporting currency and additional parameters.static CalculationRules
of(CalculationFunctions functions, ReportingCurrency reportingCurrency, CalculationParameters parameters)
Obtains an instance specifying the functions, reporting currency and additional parameters.static CalculationRules
of(CalculationFunctions functions, CalculationParameter... parameters)
Obtains an instance specifying the functions to use and some additional parameters.static CalculationRules
of(CalculationFunctions functions, CalculationParameters parameters)
Obtains an instance specifying the functions to use and some additional parameters.String
toString()
-
-
-
Method Detail
-
of
public static CalculationRules of(CalculationFunctions functions, CalculationParameter... parameters)
Obtains an instance specifying the functions to use and some additional parameters.The output will uses the "natural" reporting currency. Most functions require a parameter to control their behavior, such as
RatesMarketDataLookup
.- Parameters:
functions
- the calculation functionsparameters
- the parameters that control the calculation, may be empty- Returns:
- the rules
-
of
public static CalculationRules of(CalculationFunctions functions, CalculationParameters parameters)
Obtains an instance specifying the functions to use and some additional parameters.The output will uses the "natural" reporting currency. Most functions require a parameter to control their behavior, such as
RatesMarketDataLookup
.- Parameters:
functions
- the calculation functionsparameters
- the parameters that control the calculation, may be empty- Returns:
- the rules
-
of
public static CalculationRules of(CalculationFunctions functions, Currency reportingCurrency, CalculationParameter... parameters)
Obtains an instance specifying the functions, reporting currency and additional parameters.Most functions require a parameter to control their behavior, such as
RatesMarketDataLookup
.- Parameters:
functions
- the calculation functionsreportingCurrency
- the reporting currencyparameters
- the parameters that control the calculation, may be empty- Returns:
- the rules
-
of
public static CalculationRules of(CalculationFunctions functions, ReportingCurrency reportingCurrency, CalculationParameters parameters)
Obtains an instance specifying the functions, reporting currency and additional parameters.Most functions require a parameter to control their behavior, such as
RatesMarketDataLookup
.- Parameters:
functions
- the calculation functionsreportingCurrency
- the reporting currencyparameters
- the parameters that control the calculation, may be empty- Returns:
- the rules
-
meta
public static CalculationRules.Meta meta()
The meta-bean forCalculationRules
.- Returns:
- the meta-bean, not null
-
metaBean
public CalculationRules.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getFunctions
public CalculationFunctions getFunctions()
Gets the calculation functions.Functions provide the logic of the calculation. Each type of target must have an associated function in order for calculations to be performed.
- Returns:
- the value of the property, not null
-
getReportingCurrency
public ReportingCurrency getReportingCurrency()
Gets the reporting currency, used to control currency conversion.This is used to specify the currency that the result should be reporting in. If the result is not associated with a currency, such as for "par rate", then the reporting currency will effectively be ignored.
- Returns:
- the value of the property, not null
-
getParameters
public CalculationParameters getParameters()
Gets the calculation parameters, used to control the how the calculation is performed.Parameters are used to parameterize the
Measure
to be calculated. They may be specified in two places - here and in theColumn
. The parameters specified here are the defaults that apply to all columns.If a parameter is defined here and in the column with the same query type, then the column parameter takes precedence.
- Returns:
- the value of the property, not null
-
-