com.grandcentral.appstats.impl
Class SynchronizedTimerImpl

java.lang.Object
  |
  +--com.grandcentral.appstats.impl.StatImpl
        |
        +--com.grandcentral.appstats.impl.SynchronizedStatImpl
              |
              +--com.grandcentral.appstats.impl.SynchronizedTimerImpl
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, Stat, Timer

public class SynchronizedTimerImpl
extends SynchronizedStatImpl
implements Timer

Synchronized Timer Implementation

Copyright: Copyright (c) 2002

Company: Grand Central Communications

Version:
1.0
Author:
Taras Shkvarchuk
See Also:
Serialized Form

Fields inherited from class com.grandcentral.appstats.impl.StatImpl
m_aDouble, m_aggr, m_aLong, m_name, m_obj, m_type
 
Fields inherited from interface com.grandcentral.appstats.Stat
AGGREGATE_AVG, AGGREGATE_EXPAVG, AGGREGATE_MAX, AGGREGATE_MIN, AGGREGATE_REPLACE, AGGREGATE_SUM, DELIM_STATNAME, DELIM_STATPREFIX, DELIM_TASKPARENT, DONT_AGGREGATE, TYPE_DOUBLE, TYPE_HEIRARCH, TYPE_HIDDEN, TYPE_LONG, TYPE_OBJECT, TYPE_UNDEFINED
 
Constructor Summary
SynchronizedTimerImpl()
           
 
Method Summary
 long getLong()
           
 long getRunningTime()
          Returns total running time.
 void reset()
          clears timer value to 0
 long start()
          starts the timer and returns the start time
 long start(boolean reset)
          starts the timer and returns the start time.
 long stop()
          stops the timer and returns the timer's current value
 
Methods inherited from class com.grandcentral.appstats.impl.SynchronizedStatImpl
addType, clone, containsType, fromStringAbbr, getAggregationMethod, getDouble, getFullName, getObject, getStatName, getStatPrefix, getStatSuffix, getTaskHierarchy, getType, prependTaskName, removeType, setAggregationMethod, setDouble, setFullName, setLong, setObject, setStatName, setStatPrefix, setStatSuffix, setTaskHierarchy, setType, toStringAbbr
 
Methods inherited from class com.grandcentral.appstats.impl.StatImpl
addAggregationMethod, containsAggregationMethod, createFullName, createFullName, createStatName, getStatName, getStatPrefix, getStatSuffix, getTaskHierarchy, isValidPrefix, isValidStatName, isValidSuffix, isValidTaskName, prependTaskName, removeAggregationMethod, toString, toStringAbbr
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.grandcentral.appstats.Stat
addAggregationMethod, addType, clone, containsAggregationMethod, containsType, fromStringAbbr, getAggregationMethod, getDouble, getFullName, getObject, getStatName, getStatPrefix, getStatSuffix, getTaskHierarchy, getType, prependTaskName, removeAggregationMethod, removeType, setAggregationMethod, setDouble, setFullName, setLong, setObject, setStatName, setStatPrefix, setStatSuffix, setTaskHierarchy, setType, toStringAbbr, toStringAbbr
 

Constructor Detail

SynchronizedTimerImpl

public SynchronizedTimerImpl()
Method Detail

start

public long start()
Description copied from interface: Timer
starts the timer and returns the start time
Specified by:
start in interface Timer
Following copied from interface: com.grandcentral.appstats.Timer
Returns:
-1 if timer already running

start

public long start(boolean reset)
Description copied from interface: Timer
starts the timer and returns the start time. Optionall resets before starting timer
Specified by:
start in interface Timer
Following copied from interface: com.grandcentral.appstats.Timer
Returns:
-1 if timer already running

stop

public long stop()
Description copied from interface: Timer
stops the timer and returns the timer's current value
Specified by:
stop in interface Timer
Following copied from interface: com.grandcentral.appstats.Timer
Returns:
-1 if timer already stopped

reset

public void reset()
Description copied from interface: Timer
clears timer value to 0
Specified by:
reset in interface Timer

getRunningTime

public long getRunningTime()
Description copied from interface: Timer
Returns total running time. Calculation is up to this moment if timer is still running. This does not stop the timer.
Specified by:
getRunningTime in interface Timer

getLong

public long getLong()
Specified by:
getLong in interface Stat
Overrides:
getLong in class SynchronizedStatImpl