www.sdmetrics.com

com.sdmetrics.metrics
Class SummationHelper

java.lang.Object
  extended by com.sdmetrics.metrics.SummationHelper

public class SummationHelper
extends java.lang.Object

Processes the "sum" and "stat" attributes of metric calculation procedures.


Constructor Summary
SummationHelper(MetricsEngine engine, ProcedureAttributes attributes)
           
 
Method Summary
 void add(float value)
          Adds a value to the current total.
 void add(ModelElement element, Variables vars)
          Processes the "sum" and "stat" attributes for a model element and updates the total accordingly.
 java.lang.Number getTotal()
          Gets the current total.
 void raiseTo(float value)
          Raises the total to a specified value if it currently is below that value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SummationHelper

public SummationHelper(MetricsEngine engine,
                       ProcedureAttributes attributes)
                throws SDMetricsException
Parameters:
engine - metrics engine for expression evaluation
attributes - Attributes of the calculation procedure to process.
Throws:
SDMetricsException - That "stat" attribute is invalid
Method Detail

add

public void add(ModelElement element,
                Variables vars)
         throws SDMetricsException
Processes the "sum" and "stat" attributes for a model element and updates the total accordingly.

Parameters:
element - The model element to process.
vars - Variables for the evaluation of expressions
Throws:
SDMetricsException - An error occurred evaluating the sum expression.

add

public void add(float value)
Adds a value to the current total.

Parameters:
value - Value to add

raiseTo

public void raiseTo(float value)
Raises the total to a specified value if it currently is below that value. Leaves the total unaffected if it is already greater than the specified value.

Parameters:
value - new total value to raise to

getTotal

public java.lang.Number getTotal()
Gets the current total.

Returns:
The current total.

www.sdmetrics.com