|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.similarityfunction.structurebased.ConstantSimilarityFunction
public class ConstantSimilarityFunction
ConstantSimilarityFunction
returns a similarity that is independent from the passed DuDeObjectPair
and can be specified by the
user.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface de.hpi.fgis.dude.similarityfunction.SimilarityFunction |
---|
SimilarityFunction.SimilarityValidationState |
Constructor Summary | |
---|---|
protected |
ConstantSimilarityFunction()
Internal constructor for Jsonable deserialization. |
|
ConstantSimilarityFunction(double simValue)
Initializes the ConstantSimilarityFunction with the passed similarity. |
Method Summary | |
---|---|
SimilarityFunction.SimilarityValidationState |
getLastValidationState()
Since ConstantSimilarityFunction is not based on actual values, it returns SimilarityValidationState.BothValid for each
calculated pair. |
double |
getSimilarity(DuDeObjectPair pair)
Calculates the similarity of passed DuDeObjectPair 's members. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ConstantSimilarityFunction()
Jsonable
deserialization.
public ConstantSimilarityFunction(double simValue)
ConstantSimilarityFunction
with the passed similarity. Any call of getSimilarity(DuDeObjectPair)
will set
this similarity for the pair.
simValue
- The similarity that will be returned by getSimilarity(DuDeObjectPair)
.Method Detail |
---|
public double getSimilarity(DuDeObjectPair pair)
SimilarityFunction
DuDeObjectPair
's members. Besides returning the similarity of the pair, this method stores the
calculated similarity also in the pair using DuDeObjectPair.setSimilarity(double)
. Any already calculated similarity will be
overwritten.
getSimilarity
in interface SimilarityFunction
pair
- A pair of DuDeObjects
that shall be compared.
0.0
(not equal) and 1.0
(the same object).public SimilarityFunction.SimilarityValidationState getLastValidationState()
ConstantSimilarityFunction
is not based on actual values, it returns SimilarityValidationState.BothValid
for each
calculated pair.
getLastValidationState
in interface SimilarityFunction
SimilarityFunction.SimilarityValidationState.BothInvalid
, if
SimilarityFunction.getSimilarity(DuDeObjectPair)
was not called, yet.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |