cppncss.measure
Class Sum

java.lang.Object
  extended by cppncss.measure.Sum

public final class Sum
extends java.lang.Object

Sums a series of values.

Author:
Mathieu Champlon

Constructor Summary
Sum(java.lang.String label, int value)
          Create a sum.
 
Method Summary
 void accept(SumObserver observer)
          Accept a visitor.
 boolean update(java.lang.String label, int value)
          Add a value to the sum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sum

public Sum(java.lang.String label,
           int value)
Create a sum.

Parameters:
label - the measurement label
value - the initial value of the sum
Method Detail

update

public boolean update(java.lang.String label,
                      int value)
Add a value to the sum.

If the label does not match the label given at creation the measurement is ignored.

Parameters:
label - the label of the measurement
value - the value of the measurement
Returns:
whether the measurement has been accepted or not

accept

public void accept(SumObserver observer)
Accept a visitor.

Parameters:
observer - an average observer


Copyright © 2006-2007 null. All Rights Reserved.