Mobios v0.91

mobios.dist
Class CountedMetric

java.lang.Object
  extended by mobios.dist.CountedMetric
All Implemented Interfaces:
Serializable, Metric

public class CountedMetric
extends Object
implements Metric

Wrapper around a base Metric that counts the invocations of Metric.getDistance(IndexObject,IndexObject). Additional methods to get and clear the counter are provided.

Version:
2004.03.05
Author:
Jack, Rui Mao, Willard
See Also:
Serialized Form

Constructor Summary
CountedMetric(Metric baseMetric)
          Creates a CountedMetric with a given base Metric, setting the internal counter to zero.
 
Method Summary
 void clear()
          Sets the internal counter to zero.
 int getCounter()
          Returns the current value of the internal counter.
 double getDistance(IndexObject one, IndexObject two)
          Returns the value of Metric.getDistance(IndexObject,IndexObject) for the base Metric and increments the internal counter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountedMetric

public CountedMetric(Metric baseMetric)
Creates a CountedMetric with a given base Metric, setting the internal counter to zero.

Method Detail

getDistance

public final double getDistance(IndexObject one,
                                IndexObject two)
Returns the value of Metric.getDistance(IndexObject,IndexObject) for the base Metric and increments the internal counter.

Specified by:
getDistance in interface Metric
Parameters:
one - the first IndexObject to compute distance on
two - the second IndexObject to compute distance on
Returns:
the distance between the two objects

getCounter

public final int getCounter()
Returns the current value of the internal counter.


clear

public final void clear()
Sets the internal counter to zero.


Mobios v0.91

(C) 2002 - 2006 The MoBIoS Group