|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.similarityfunction.AbstractSimilarityFunction de.hpi.fgis.dude.similarityfunction.contentbased.ContentBasedSimilarityFunction<RelativeNumberDiffFunction> de.hpi.fgis.dude.similarityfunction.contentbased.impl.RelativeNumberDiffFunction
public class RelativeNumberDiffFunction
This SimilarityFunction
implementation checks the relative variation of the numbers of two DuDeObject
attributes. The maximum
allowed variation is defined by percentage (of the higher of the two value).
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface de.hpi.fgis.dude.similarityfunction.SimilarityFunction |
---|
SimilarityFunction.SimilarityValidationState |
Field Summary | |
---|---|
static double |
DEFAULT_MAX_TOLERANCE_FACTOR
The default maximum tolerance factor that is used, if no other factor is set. |
protected static double |
DOUBLE_EQUALITY_EPSILON
The allowed variation of two doubles, so that the two values are regarded as equal. |
protected double |
maxToleranceFactor
The maximum percentage of allowed absolute variation. |
Constructor Summary | |
---|---|
protected |
RelativeNumberDiffFunction()
Internal constructor for Jsonable deserialization. |
|
RelativeNumberDiffFunction(double maxToleranceFactor,
int attrIndex,
String... defaultAttr)
The constructor initializes the RelativeNumberDiffFunction . |
|
RelativeNumberDiffFunction(double maxToleranceFactor,
String... defaultAttr)
The constructor initializes the RelativeNumberDiffFunction . |
|
RelativeNumberDiffFunction(int attrIndex,
String... defaultAttr)
The constructor initializes the RelativeNumberDiffFunction . |
|
RelativeNumberDiffFunction(String... defaultAttr)
The constructor initializes the RelativeNumberDiffFunction . |
Method Summary | |
---|---|
protected double |
compareAtomicValues(JsonAtomic value1,
JsonAtomic value2)
Calculates the similarity of the two passed JsonAtomic s. |
boolean |
equals(Object obj)
|
protected double |
getMaxAllowedVariation(double value1,
double value2)
Gets the maximum allowed variation based on the maxToleranceFactor . |
int |
hashCode()
|
String |
toString()
|
Methods inherited from class de.hpi.fgis.dude.similarityfunction.contentbased.ContentBasedSimilarityFunction |
---|
addAttribute, calculateSimilarity, calculateSimilarity, getAttribute, ignoreCapitalization, ignoringCapitalizationEnabled, setCompareArrayArrayStrategy, setCompareArrayAtomicStrategy, setCompareArrayRecordStrategy, setCompareRecordAtomicStrategy, setCompareRecordRecordStrategy |
Methods inherited from class de.hpi.fgis.dude.similarityfunction.AbstractSimilarityFunction |
---|
getLastValidationState, getSimilarity, setValidationState |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double DEFAULT_MAX_TOLERANCE_FACTOR
protected double maxToleranceFactor
protected static final double DOUBLE_EQUALITY_EPSILON
Constructor Detail |
---|
protected RelativeNumberDiffFunction()
Jsonable
deserialization.
public RelativeNumberDiffFunction(String... defaultAttr)
RelativeNumberDiffFunction
.
defaultAttr
- The default attribute.public RelativeNumberDiffFunction(int attrIndex, String... defaultAttr)
RelativeNumberDiffFunction
.
attrIndex
- The index of the default attribute. This parameter is used to select specific values of an array.defaultAttr
- The default attribute.public RelativeNumberDiffFunction(double maxToleranceFactor, String... defaultAttr)
RelativeNumberDiffFunction
.
maxToleranceFactor
- The percentage of maximum allowed variation.defaultAttr
- The default attribute.public RelativeNumberDiffFunction(double maxToleranceFactor, int attrIndex, String... defaultAttr)
RelativeNumberDiffFunction
.
maxToleranceFactor
- The percentage of maximum allowed variation.attrIndex
- The index of the default attribute. This parameter is used to select specific values of an array.defaultAttr
- The default attribute.Method Detail |
---|
protected double compareAtomicValues(JsonAtomic value1, JsonAtomic value2)
ContentBasedSimilarityFunction
JsonAtomic
s.
compareAtomicValues
in class ContentBasedSimilarityFunction<RelativeNumberDiffFunction>
value1
- The first atomic value.value2
- The second atomic value.
public boolean equals(Object obj)
equals
in class ContentBasedSimilarityFunction<RelativeNumberDiffFunction>
protected double getMaxAllowedVariation(double value1, double value2)
maxToleranceFactor
.
value1
- The first value.value2
- The second value.
public int hashCode()
hashCode
in class ContentBasedSimilarityFunction<RelativeNumberDiffFunction>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |