com.opengamma.strata.calc

## Class CalculationRules

• All Implemented Interfaces:
Bean, ImmutableBean

public final class CalculationRules
extends Object
implements 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 with Column. 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 and Description
static class  CalculationRules.Meta
The meta-bean for CalculationRules.
• ### Method Summary

All Methods
Modifier and Type Method and 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 for CalculationRules.
CalculationRules.Meta metaBean()
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.
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.
<R> Property<R> property(String propertyName)
Set<String> propertyNames()
String toString()
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait
• ### 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 functions
parameters - 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 functions
parameters - 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 functions
reportingCurrency - the reporting currency
parameters - 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 functions
reportingCurrency - the reporting currency
parameters - the parameters that control the calculation, may be empty
Returns:
the rules
• #### meta

public static CalculationRules.Meta meta()
The meta-bean for CalculationRules.
Returns:
the meta-bean, not null
• #### metaBean

public CalculationRules.Meta metaBean()
Specified by:
metaBean in interface Bean
• #### property

public <R> Property<R> property(String propertyName)
Specified by:
property in interface Bean
• #### propertyNames

public Set<String> propertyNames()
Specified by:
propertyNames in interface 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 the Column. 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
• #### equals

public boolean equals(Object obj)
Overrides:
equals in class Object
• #### hashCode

public int hashCode()
Overrides:
hashCode in class Object
• #### toString

public String toString()
Overrides:
toString in class Object