com.jeantessier.metrics
Class NameListMeasurement

java.lang.Object
  |
  +--com.jeantessier.metrics.MeasurementBase
        |
        +--com.jeantessier.metrics.NameListMeasurement
All Implemented Interfaces:
CollectionMeasurement, Measurement

public class NameListMeasurement
extends MeasurementBase
implements CollectionMeasurement

Accumulates a set of values. Its numerical value is the cardinality (i.e., size) of the set. OOMetrics uses it to keep track of dependencies.

This is the syntax for initializing this type of measurement:

  <init>
      [SET | LIST]
  </init>
  

Defaults to SET (i.e., does not count duplicates).


Constructor Summary
NameListMeasurement(MeasurementDescriptor descriptor, Metrics context, java.lang.String initText)
           
 
Method Summary
 void accept(MeasurementVisitor visitor)
           
 void add(java.lang.Object object)
           
protected  double compute()
           
 java.lang.Number getValue()
           
 java.util.Collection getValues()
           
 boolean isEmpty()
           
 
Methods inherited from class com.jeantessier.metrics.MeasurementBase
add, add, add, add, doubleValue, floatValue, getContext, getDescriptor, getLongName, getShortName, intValue, isCached, isInRange, longValue, perl, setCached, setEmpty, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.jeantessier.metrics.Measurement
add, add, add, add, doubleValue, floatValue, getContext, getDescriptor, getLongName, getShortName, intValue, isInRange, longValue
 

Constructor Detail

NameListMeasurement

public NameListMeasurement(MeasurementDescriptor descriptor,
                           Metrics context,
                           java.lang.String initText)
Method Detail

add

public void add(java.lang.Object object)
Specified by:
add in interface Measurement
Overrides:
add in class MeasurementBase

accept

public void accept(MeasurementVisitor visitor)
Specified by:
accept in interface Measurement

getValue

public java.lang.Number getValue()
Specified by:
getValue in interface Measurement
Overrides:
getValue in class MeasurementBase

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Measurement
Overrides:
isEmpty in class MeasurementBase

compute

protected double compute()
Overrides:
compute in class MeasurementBase

getValues

public java.util.Collection getValues()
Specified by:
getValues in interface CollectionMeasurement


Dependency Finder 1.1.0 © 2001-2004 Jean Tessier.