patterntesting.runtime.monitor
Class AbstractProfileMonitor

Package class diagram package AbstractProfileMonitor
java.lang.Object
  extended by patterntesting.runtime.monitor.AbstractProfileMonitor
All Implemented Interfaces:
Comparable<ProfileMonitor>, ProfileMonitor
Direct Known Subclasses:
JamonMonitor, SimpleProfileMonitor

public abstract class AbstractProfileMonitor
extends Object
implements ProfileMonitor

Since:
27.12.2008
Version:
$Revision: 1.8 $
Author:
oliver

Constructor Summary
AbstractProfileMonitor()
           
 
Method Summary
 int compareTo(ProfileMonitor other)
          The ProfileMonitor with the higher number of totals is considered as "greater".
 boolean equals(AbstractProfileMonitor other)
          If the Comparable.compareTo(Object) returns 0 the two objects are equals.
 boolean equals(Object other)
          If we impmlement the Comparable.compareTo(Object) method we should also implement/overwrite the Object.equals(Object) method.
 String getLastTime()
          Gets the last value as time string.
 int hashCode()
          Hash code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface patterntesting.runtime.monitor.ProfileMonitor
add, getActive, getAvg, getAvgActive, getFirstAccess, getHits, getLabel, getLastAccess, getLastValue, getMax, getMaxActive, getMin, getMonitors, getTotal, getUnits, reset, start, stop, toCsvHeadline, toCsvString, toShortString
 

Constructor Detail

AbstractProfileMonitor

public AbstractProfileMonitor()
Method Detail

compareTo

public final int compareTo(ProfileMonitor other)
The ProfileMonitor with the higher number of totals is considered as "greater".

Specified by:
compareTo in interface Comparable<ProfileMonitor>
Parameters:
other - the other ProfileMonitor
Returns:
0 if both ProfileMonitors has the same results

getLastTime

public final String getLastTime()
Gets the last value as time string. It returns the same result as ProfileMonitor.getLastValue() but in a human readable format. The english locale is used for formatting because this method is normally used for logging (which should be normally done in English).

Specified by:
getLastTime in interface ProfileMonitor
Returns:
the last time (e.g. "42 seconds")
Since:
1.4.2

equals

public boolean equals(Object other)
If we impmlement the Comparable.compareTo(Object) method we should also implement/overwrite the Object.equals(Object) method.

Overrides:
equals in class Object
Parameters:
other - the other
Returns:
true, if successful
See Also:
Object.equals(java.lang.Object)

equals

public boolean equals(AbstractProfileMonitor other)
If the Comparable.compareTo(Object) returns 0 the two objects are equals.

Parameters:
other - the other
Returns:
true, if successful

hashCode

public int hashCode()
Hash code.

Overrides:
hashCode in class Object
Returns:
the int
See Also:
Object.hashCode()


Copyright © 2002–2014 PatternTesting Team. All rights reserved.