net.sf.sensor.meter
Class MeterStatistics

java.lang.Object
  extended bynet.sf.sensor.meter.MeterStatistics

public class MeterStatistics
extends Object

Author:
Age Mooy

Constructor Summary
MeterStatistics(net.sf.sensor.meter.MeterData meterData)
           
 
Method Summary
 long getAverageValue()
          Returns the averageValue.
 long getCurrentValue()
          Returns the currentValue.
 String getLabel()
          Returns the String label that uniquely identifies this instance.
 long getMaximumValue()
          Returns the maximumValue.
 long getMinimumValue()
          Returns the minimumValue.
 long getNumberOfValueChanges()
          Returns the numberOfValueChanges.
 long getStandardDeviation()
          Returns the standardDeviation.
 long getSumOfSquaresOfValues()
          Returns the sumOfSquaresOfValues.
 long getSumOfValues()
          Returns the sumOfValues.
 long getTimeOfFirstUpdate()
          Returns the timeOfFirstUpdate in millseconds since the usual 01-01-1970 00:00 UTC.
 long getTimeOfLastUpdate()
          Returns the timeOfLastUpdate in millseconds since the usual 01-01-1970 00:00 UTC.
 void refresh()
          Refreshes this instances and all its children.
 void refreshFromData(long currentValue, long numberOfValueChanges, long sumOfValues, long averageValue, long standardDeviation, long minimumValue, long maximumValue, long timeOfFirstUpdate, long timeOfLastUpdate, long sumOfSquaresOfValues)
          Callback method called from MeterData#refreshStatistics(MeterStatistics) to update all statistics.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MeterStatistics

public MeterStatistics(net.sf.sensor.meter.MeterData meterData)
Parameters:
meterData -
Method Detail

getLabel

public String getLabel()
Returns the String label that uniquely identifies this instance.

Returns:
the String label that uniquely identifies this instance.

refresh

public void refresh()
Refreshes this instances and all its children.


refreshFromData

public void refreshFromData(long currentValue,
                            long numberOfValueChanges,
                            long sumOfValues,
                            long averageValue,
                            long standardDeviation,
                            long minimumValue,
                            long maximumValue,
                            long timeOfFirstUpdate,
                            long timeOfLastUpdate,
                            long sumOfSquaresOfValues)
Callback method called from MeterData#refreshStatistics(MeterStatistics) to update all statistics. Package private because it should only be called from the associated MeterData.

Parameters:
currentValue - the new value of currentValue.
numberOfValueChanges - the new value of numberOfValueChanges.
sumOfValues - the new value of sumOfValues.
averageValue - the new value of averageValue.
standardDeviation - the new value of standardDeviation.
minimumValue - the new value of minimumValue.
maximumValue - the new value of maximumValue.
timeOfFirstUpdate - the new value of timeOfFirstUpdate.
timeOfLastUpdate - the new value of timeOfLastUpdate.
sumOfSquaresOfValues - the new value of sumOfSquaresOfValues.

getCurrentValue

public long getCurrentValue()
Returns the currentValue.

Returns:
Returns the currentValue.

getNumberOfValueChanges

public long getNumberOfValueChanges()
Returns the numberOfValueChanges.

Returns:
Returns the numberOfValueChanges.

getSumOfValues

public long getSumOfValues()
Returns the sumOfValues.

Returns:
Returns the sumOfValues.

getAverageValue

public long getAverageValue()
Returns the averageValue.

Returns:
Returns the averageValue.

getStandardDeviation

public long getStandardDeviation()
Returns the standardDeviation.

Returns:
Returns the standardDeviation.

getSumOfSquaresOfValues

public long getSumOfSquaresOfValues()
Returns the sumOfSquaresOfValues.

Returns:
Returns the sumOfSquaresOfValues.

getMinimumValue

public long getMinimumValue()
Returns the minimumValue.

Returns:
Returns the minimumValue.

getMaximumValue

public long getMaximumValue()
Returns the maximumValue.

Returns:
Returns the maximumValue.

getTimeOfFirstUpdate

public long getTimeOfFirstUpdate()
Returns the timeOfFirstUpdate in millseconds since the usual 01-01-1970 00:00 UTC.

Returns:
the timeOfFirstUpdate in millseconds since the usual 01-01-1970 00:00 UTC.

getTimeOfLastUpdate

public long getTimeOfLastUpdate()
Returns the timeOfLastUpdate in millseconds since the usual 01-01-1970 00:00 UTC.

Returns:
the timeOfLastUpdate in millseconds since the usual 01-01-1970 00:00 UTC.

toString

public String toString()
See Also:
Object.toString()


Copyright © 2005-2006 SourceForge. All Rights Reserved.