Esempio n. 1
0
        /// <summary>
        /// Obtains an instance that will calculate the specified measure, defining the column name and parameters.
        /// <para>
        /// The specified calculation parameters take precedence over those in <seealso cref="CalculationRules"/>,
        /// with the combined set being used for the column.
        /// Currency conversion is controlled by the reporting currency in {@code CalculationRules}.
        ///
        /// </para>
        /// </summary>
        /// <param name="measure">  the measure to be calculated </param>
        /// <param name="columnName">  the column name </param>
        /// <param name="parameters">  the parameters that control the calculation, may be empty </param>
        /// <returns> a column with the specified measure, column name and reporting currency </returns>
        public static Column of(Measure measure, string columnName, params CalculationParameter[] parameters)
        {
            ColumnName name = ColumnName.of(columnName);

            return(new Column(name, measure, null, CalculationParameters.of(parameters)));
        }
Esempio n. 2
0
        /// <summary>
        /// Obtains an instance that will calculate the specified measure, converting to the specified currency,
        /// defining the column name and parameters.
        /// <para>
        /// The specified calculation parameters take precedence over those in <seealso cref="CalculationRules"/>,
        /// with the combined set being used for the column.
        ///
        /// </para>
        /// </summary>
        /// <param name="measure">  the measure to be calculated </param>
        /// <param name="columnName">  the column name </param>
        /// <param name="currency">  the currency to convert to </param>
        /// <param name="parameters">  the parameters that control the calculation, may be empty </param>
        /// <returns> a column with the specified measure, column name and reporting currency </returns>
        public static Column of(Measure measure, string columnName, Currency currency, params CalculationParameter[] parameters)
        {
            ColumnName name = ColumnName.of(columnName);

            return(new Column(name, measure, ReportingCurrency.of(currency), CalculationParameters.of(parameters)));
        }
        //-------------------------------------------------------------------------
        /// <summary>
        /// Obtains an instance specifying the functions to use and some additional parameters.
        /// <para>
        /// The output will uses the "natural" <seealso cref="ReportingCurrency reporting currency"/>.
        /// Most functions require a parameter to control their behavior, such as {@code RatesMarketDataLookup}.
        ///
        /// </para>
        /// </summary>
        /// <param name="functions">  the calculation functions </param>
        /// <param name="parameters">  the parameters that control the calculation, may be empty </param>
        /// <returns> the rules </returns>
        public static CalculationRules of(CalculationFunctions functions, params CalculationParameter[] parameters)
        {
            CalculationParameters @params = CalculationParameters.of(parameters);

            return(new CalculationRules(functions, ReportingCurrency.NATURAL, @params));
        }