Accumulator used to add the results of a calculation.
Inheritance Hierarchy
Spotfire.Dxp.Application.CalculationsResultAccumulator
Namespace: Spotfire.Dxp.Application.Calculations
Assembly: Spotfire.Dxp.Application (in Spotfire.Dxp.Application.dll) Version: 65.0.19510.3242 (65.0.19510.3242)
Syntax
C#
public sealed class ResultAccumulator : IDisposable
The ResultAccumulator type exposes the following members.
Methods
Name | Description | |
---|---|---|
AddColumns(CalculationResultsIdentifier, DataTable, ColumnBuilder) |
Adds a column to an existing table or replaces it if it already exist.
| |
AddColumns(CalculationResultsIdentifier, DataTable, IEnumerableColumnBuilder) |
Adds columns to an existing table or replaces them if they already exist.
| |
AddTable(CalculationResultsIdentifier, String, ColumnBuilder) |
Adds a completely new DataTable consisting of the columns provided here or replaces them if the table already exists.
| |
AddTable(CalculationResultsIdentifier, String, IEnumerableColumnBuilder) |
Adds a completely new DataTable consisting of the columns provided here or replaces them if the table already exists.
| |
Dispose |
Disposes this ResultAccumulator | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Examples
protected override void CalculateCore(ResultAccumulator resultAccumulator) { //Get one or more column builders. ColumnBuilder<double> builder = GetColumnBuilder<double>(col.Name); // Perform the calculation and add items to the builder. ... builder.AddItem(2.0) ... // Naming combined with updates, deletions and uniqueness can be a surprisingly tricky thing. // This is one relatively hasslefree way of dealing with naming where the user doesn't get to name the table but // possibly the calculation itself. We let the framework take care of making names unique. // Then the user can only rename the table through the normal rename table interface in Data Table Properties. Alternatively it can // be renamed explicitly by the user in the update step. If the UI wants to pre-check // uniqueness remember the update scenario so you don't include the tablename you are about to update in the taken names. string targetTableName = null; if (CalculationResults.MyNewTable == null) { targetTableName = CalculationSettings.GetAncestor<Calculation>().Name; } else { targetTableName = CalculationResults.MyNewTable.Name; } //add a completely new table resultAccumulator.AddTable(MyCalculationResults.CalculationResultsIdentifiers.MyNewTable, targetTableName, myColumnBuilders); //and add some columns to an existing table resultAccumulator.AddColumns(MyCalculationResults.CalculationResultsIdentifiers.MyColumn, CalculationSettings.TableToPutResultIn, builder); }
Version Information
Supported in: 14.3, 14.2, 14.1, 14.0, 12.5, 12.4, 12.3, 12.2, 12.1, 12.0, 11.8
See Also