net.sourceforge.nite.datainspection.impl
Class DiceMetric

java.lang.Object
  extended by net.sourceforge.nite.datainspection.impl.DiceMetric
All Implemented Interfaces:
DistanceMetric

public class DiceMetric
extends java.lang.Object
implements DistanceMetric

class DiceMetric for distance metrics on SetValues

See Also:
Value, SetValue

Constructor Summary
DiceMetric()
           
 
Method Summary
 double distance(Value f, Value s)
          implements distance of interface DistanceMetric using Dice coefficient on two given sets
 int nrOfCommonElements(java.util.Set f, java.util.Set s)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiceMetric

public DiceMetric()
Method Detail

distance

public double distance(Value f,
                       Value s)
implements distance of interface DistanceMetric using Dice coefficient on two given sets

Specified by:
distance in interface DistanceMetric
Parameters:
f - and s must be SetValues not null
Returns:
1- (the Dice coefficient of f and s)

nrOfCommonElements

public int nrOfCommonElements(java.util.Set f,
                              java.util.Set s)
Returns:
the number of elements in the product set of f and s