public abstract class ValueAccumulator<T>


Accumulates a set of stored values into a single total value.

Type Parameters

TThe type of value to accumulate.


valuesThe stored values with their given identifiers (Read only).
TotalThe total accumulated value (Read only).
CountThe number of unique values being accumulated (Read only).
DefaultValueThe default value of T.


ValueAccumulatorCreates a new instance of the value accumulator.


GetValueReturns the value stored with the specified identifier.
SetValueStores a given value with the specified identifier. The total accumulated value is updated based on the difference between the new and old value.
RemoveValueRemoves the value stored with the given identifier and updates the total accumulated value.
ClearRemoves all stored values and resets the total accumulated value.
AddIncreases the accumulated total by a given value.
SubtractDecreases the accumulated total by a given value.