public final class Column extends Object implements org.joda.beans.ImmutableBean
CalculationRunner provides the ability to calculate a grid of results
for a given set targets and columns. This class is used to define the columns.
A column is defined in terms of a unique name, measure to be calculated and
a set of parameters that control the calculation. The functions to invoke
and the default set of parameters are defined on CalculationRules.
| Modifier and Type | Class and Description |
|---|---|
static class |
Column.Builder
The bean-builder for
Column. |
static class |
Column.Meta
The meta-bean for
Column. |
| Modifier and Type | Method and Description |
|---|---|
static Column.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
Column |
combineWithDefaults(ReportingCurrency reportingCurrency,
CalculationParameters defaultParameters)
Combines the parameters with another reporting currency and set of parameters.
|
boolean |
equals(Object obj) |
Measure |
getMeasure()
Gets the measure to be calculated.
|
ColumnName |
getName()
Gets the column name.
|
CalculationParameters |
getParameters()
Gets the calculation parameters that apply to this column, used to control the how the calculation is performed.
|
Optional<ReportingCurrency> |
getReportingCurrency()
Gets the reporting currency, used to control currency conversion, optional.
|
int |
hashCode() |
static Column.Meta |
meta()
The meta-bean for
Column. |
Column.Meta |
metaBean() |
static Column |
of(Measure measure)
Obtains an instance that will calculate the specified measure.
|
static Column |
of(Measure measure,
CalculationParameter... parameters)
Obtains an instance that will calculate the specified measure, defining additional parameters.
|
static Column |
of(Measure measure,
Currency currency)
Obtains an instance that will calculate the specified measure, converting to the specified currency.
|
static Column |
of(Measure measure,
Currency currency,
CalculationParameter... parameters)
Obtains an instance that will calculate the specified measure, converting to the specified currency,
defining additional parameters.
|
static Column |
of(Measure measure,
String columnName)
Obtains an instance that will calculate the specified measure, defining the column name.
|
static Column |
of(Measure measure,
String columnName,
CalculationParameter... parameters)
Obtains an instance that will calculate the specified measure, defining the column name and parameters.
|
static Column |
of(Measure measure,
String columnName,
Currency currency)
Obtains an instance that will calculate the specified measure, converting to the specified currency.
|
static Column |
of(Measure measure,
String columnName,
Currency currency,
CalculationParameter... parameters)
Obtains an instance that will calculate the specified measure, converting to the specified currency,
defining the column name and parameters.
|
Column.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
ColumnHeader |
toHeader()
Converts this column to a column header.
|
String |
toString() |
public static Column of(Measure measure)
The column name will be the same as the name of the measure.
No calculation parameters are provided, thus the parameters from CalculationRules will be used.
Currency conversion is controlled by the reporting currency in CalculationRules.
measure - the measure to be calculatedpublic static Column of(Measure measure, Currency currency)
The column name will be the same as the name of the measure.
measure - the measure to be calculatedcurrency - the currency to convert topublic static Column of(Measure measure, CalculationParameter... parameters)
The column name will be the same as the name of the measure.
The specified calculation parameters take precedence over those in CalculationRules,
with the combined set being used for the column.
Currency conversion is controlled by the reporting currency in CalculationRules.
measure - the measure to be calculatedparameters - the parameters that control the calculation, may be emptypublic static Column of(Measure measure, Currency currency, CalculationParameter... parameters)
The column name will be the same as the name of the measure.
The specified calculation parameters take precedence over those in CalculationRules,
with the combined set being used for the column.
measure - the measure to be calculatedcurrency - the currency to convert toparameters - the parameters that control the calculation, may be emptypublic static Column of(Measure measure, String columnName)
No calculation parameters are provided, thus the parameters from CalculationRules will be used.
Currency conversion is controlled by the reporting currency in CalculationRules.
measure - the measure to be calculatedcolumnName - the column namepublic static Column of(Measure measure, String columnName, Currency currency)
The specified currency will be wrapped in ReportingCurrency and added to the calculation parameters.
measure - the measure to be calculatedcolumnName - the column namecurrency - the currency to convert topublic static Column of(Measure measure, String columnName, CalculationParameter... parameters)
The specified calculation parameters take precedence over those in CalculationRules,
with the combined set being used for the column.
Currency conversion is controlled by the reporting currency in CalculationRules.
measure - the measure to be calculatedcolumnName - the column nameparameters - the parameters that control the calculation, may be emptypublic static Column of(Measure measure, String columnName, Currency currency, CalculationParameter... parameters)
The specified calculation parameters take precedence over those in CalculationRules,
with the combined set being used for the column.
measure - the measure to be calculatedcolumnName - the column namecurrency - the currency to convert toparameters - the parameters that control the calculation, may be emptypublic Column combineWithDefaults(ReportingCurrency reportingCurrency, CalculationParameters defaultParameters)
reportingCurrency - the default reporting currencydefaultParameters - the default parameterspublic ColumnHeader toHeader()
The header is a reduced form of the column used in Results.
public static Column.Meta meta()
Column.public static Column.Builder builder()
public Column.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic ColumnName getName()
This is the name of the column, and should be unique in a list of columns.
public Measure getMeasure()
This defines the calculation being performed, such as 'PresentValue' or 'ParRate'.
public Optional<ReportingCurrency> getReportingCurrency()
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.
If empty, the reporting currency from CalculationRules will be used.
public CalculationParameters getParameters()
The parameters from CalculationRules and Column are combined.
If a parameter is defined here and in the rules with the same
query type, then the column parameter takes precedence.
When building, these will default to be empty.
public Column.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.