messif.statistics
Class StatisticObject

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

public class StatisticObject
extends Statistics<StatisticObject>

See Also:
Serialized Form

Field Summary
protected  java.lang.Object value
          Object operation
 
Fields inherited from class messif.statistics.Statistics
replaceWith
 
Constructor Summary
protected StatisticObject(java.lang.String name)
          Creates a new instance of StatisticObject
 
Method Summary
protected  StatisticObject cast()
          Returns this statistics as the type provided typed argument.
 java.lang.Object get()
           
static StatisticObject getStatistics(java.lang.String name)
          Create new statistic object with specified name or get the one already existing
 boolean changedSinceCheckpoint()
          Reports if value of statistic has been changed since the last setCheckpoint() call.
 void reset()
          Reset the current statistic (this one only).
 void set(java.lang.Object object)
           
protected  void setFrom(StatisticObject 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(StatisticObject 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

value

protected java.lang.Object value
Object operation

Constructor Detail

StatisticObject

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

Method Detail

set

public void set(java.lang.Object object)

get

public java.lang.Object get()

updateFrom

protected void updateFrom(StatisticObject sourceStat)
Statistics merging

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

setFrom

protected void setFrom(StatisticObject 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<StatisticObject>
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<StatisticObject>

getStatistics

public static StatisticObject getStatistics(java.lang.String name)
                                     throws java.lang.ClassCastException
Create new statistic object 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 statistic has been changed since the last setCheckpoint() call.


setCheckpoint

public void setCheckpoint()
Sets checkpoint. Stores the current state of value object.


cast

protected StatisticObject 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<StatisticObject>
Returns:
this statistics