com.jeantessier.metrics
Class MeasurementBase

java.lang.Object
  |
  +--com.jeantessier.metrics.MeasurementBase
All Implemented Interfaces:
Measurement
Direct Known Subclasses:
AccumulatorMeasurement, CounterMeasurement, NameListMeasurement, NbSubMetricsMeasurement, RatioMeasurement, StatisticalMeasurement, SumMeasurement

public abstract class MeasurementBase
extends java.lang.Object
implements Measurement


Constructor Summary
MeasurementBase(MeasurementDescriptor descriptor, Metrics context, java.lang.String init_text)
           
 
Method Summary
 void Add(double d)
           
 void Add(float f)
           
 void Add(int i)
           
 void Add(long l)
           
 void Add(java.lang.Object object)
           
protected  boolean Cached()
          Tells this instance if it should reuse a previously computed value or if it should regenerate it.
protected  void Cached(boolean cached)
          Sets the caching flag, telling this instance if its value has been computed.
protected abstract  double Compute()
           
 Metrics Context()
           
 MeasurementDescriptor Descriptor()
           
 double doubleValue()
           
 float floatValue()
           
 boolean InRange()
           
 int intValue()
           
 java.lang.String LongName()
           
 long longValue()
           
protected static org.apache.oro.text.perl.Perl5Util Perl()
           
 java.lang.String ShortName()
           
 java.lang.Number Value()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jeantessier.metrics.Measurement
Accept
 

Constructor Detail

MeasurementBase

public MeasurementBase(MeasurementDescriptor descriptor,
                       Metrics context,
                       java.lang.String init_text)
Method Detail

Perl

protected static org.apache.oro.text.perl.Perl5Util Perl()

Descriptor

public MeasurementDescriptor Descriptor()
Specified by:
Descriptor in interface Measurement

Context

public Metrics Context()
Specified by:
Context in interface Measurement

Cached

protected boolean Cached()
Tells this instance if it should reuse a previously computed value or if it should regenerate it.

Cached

protected void Cached(boolean cached)
Sets the caching flag, telling this instance if its value has been computed. This flag is conditional to caching being enabled in the corresponding descriptor.

ShortName

public java.lang.String ShortName()
Specified by:
ShortName in interface Measurement

LongName

public java.lang.String LongName()
Specified by:
LongName in interface Measurement

Value

public java.lang.Number Value()
Specified by:
Value in interface Measurement

intValue

public int intValue()
Specified by:
intValue in interface Measurement

longValue

public long longValue()
Specified by:
longValue in interface Measurement

floatValue

public float floatValue()
Specified by:
floatValue in interface Measurement

doubleValue

public double doubleValue()
Specified by:
doubleValue in interface Measurement

Add

public void Add(java.lang.Object object)
Specified by:
Add in interface Measurement

InRange

public boolean InRange()
Specified by:
InRange in interface Measurement

Add

public void Add(int i)
Specified by:
Add in interface Measurement

Add

public void Add(long l)
Specified by:
Add in interface Measurement

Add

public void Add(float f)
Specified by:
Add in interface Measurement

Add

public void Add(double d)
Specified by:
Add in interface Measurement

Compute

protected abstract double Compute()