messif.statistics
Class StatisticMinMaxCounter

java.lang.Object
  extended by messif.statistics.Statistics<StatisticMinMaxCounter>
      extended by messif.statistics.StatisticMinMaxCounter
All Implemented Interfaces:
java.io.Serializable

public final class StatisticMinMaxCounter
extends Statistics<StatisticMinMaxCounter>

See Also:
Serialized Form

Field Summary
protected  long count
           
protected  double max
           
protected  double min
          Counter operation
protected  double sum
           
 
Fields inherited from class messif.statistics.Statistics
replaceWith
 
Constructor Summary
protected StatisticMinMaxCounter(java.lang.String name)
          Creates a new instance of StatisticCounter
 
Method Summary
 void addValue(double value)
           
protected  StatisticMinMaxCounter cast()
          Returns this statistics as the type provided typed argument.
 void clear()
           
 double getAvg()
           
 double getCnt()
           
 double getMax()
           
 double getMin()
           
static StatisticMinMaxCounter getStatistics(java.lang.String name)
          Create new statistic counter with specified name or get the one already existing
 double getSum()
           
 boolean changedSinceCheckpoint()
          Reports if value of min/max has been changed since the last setCheckpoint() call.
 void removeValue(double value)
           
 void reset()
          Reset the current statistic (this one only).
protected  void setFrom(StatisticMinMaxCounter sourceStat)
          Set the value of this statistic to the actual value of the given sourceStat.
 void setCheckpoint()
          Sets checkpoint.
 java.lang.String toString()
          Text representation
protected  void updateFrom(StatisticMinMaxCounter sourceStat)
          Statistics merging
 
Methods inherited from class messif.statistics.Statistics
addBoundStat, bindTo, canPerformOperation, disableGlobally, enableGlobally, getAllStatistics, getAllStatistics, getBoundStats, getBoundTo, getName, getStatistics, isBound, isEnabledGlobally, isRegisteredGlobally, printStatistics, printStatistics, printStatistics, readResolve, removeBoundStat, removeStatistic, resetStatistics, resetStatistics, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

min

protected double min
Counter operation


max

protected double max

sum

protected double sum

count

protected long count
Constructor Detail

StatisticMinMaxCounter

protected StatisticMinMaxCounter(java.lang.String name)
Creates a new instance of StatisticCounter

Method Detail

addValue

public void addValue(double value)

removeValue

public void removeValue(double value)

clear

public void clear()

getMin

public double getMin()

getMax

public double getMax()

getSum

public double getSum()

getCnt

public double getCnt()

getAvg

public double getAvg()

updateFrom

protected void updateFrom(StatisticMinMaxCounter sourceStat)
Statistics merging

Specified by:
updateFrom in class Statistics<StatisticMinMaxCounter>
Parameters:
sourceStat - the statistic from which to update this stat

setFrom

protected void setFrom(StatisticMinMaxCounter sourceStat)
Description copied from class: Statistics
Set the value of this statistic to the actual value of the given sourceStat.

Specified by:
setFrom in class Statistics<StatisticMinMaxCounter>
Parameters:
sourceStat - the statistic from which to set this stat

reset

public void reset()
Reset the current statistic (this one only).

Specified by:
reset in class Statistics<StatisticMinMaxCounter>

getStatistics

public static StatisticMinMaxCounter getStatistics(java.lang.String name)
                                            throws java.lang.ClassCastException
Create new statistic counter with specified name or get the one already existing

Throws:
java.lang.ClassCastException

toString

public java.lang.String toString()
Text representation

Overrides:
toString in class java.lang.Object

changedSinceCheckpoint

public boolean changedSinceCheckpoint()
Reports if value of min/max has been changed since the last setCheckpoint() call.


setCheckpoint

public void setCheckpoint()
Sets checkpoint. Stores the current state of min/max.


cast

protected StatisticMinMaxCounter cast()
Description copied from class: Statistics
Returns this statistics as the type provided typed argument. This is a convenience method to avoid unchecked casts.

Specified by:
cast in class Statistics<StatisticMinMaxCounter>
Returns:
this statistics