Package com.tonic.analysis.fingerprint
Class FingerprintComparator
- java.lang.Object
-
- com.tonic.analysis.fingerprint.FingerprintComparator
-
public class FingerprintComparator extends Object
Scorer that compares two method fingerprints into a weighted similarity score with a confidence estimate.
-
-
Constructor Summary
Constructors Constructor Description FingerprintComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FingerprintMatchcompare(MethodFingerprint a, MethodFingerprint b)Compares two fingerprints level by level, using exact hash equality or feature similarity per level.booleanisDefiniteMatch(FingerprintMatch match)Decides whether a match is near-certain, requiring score at least 0.95 and confidence at least 0.8.booleanisLikelyMatch(FingerprintMatch match, double threshold)Decides whether a match is likely, requiring the given score threshold and confidence at least 0.5.
-
-
-
Method Detail
-
compare
public FingerprintMatch compare(MethodFingerprint a, MethodFingerprint b)
Compares two fingerprints level by level, using exact hash equality or feature similarity per level.- Parameters:
a- the first fingerprintb- the second fingerprint- Returns:
- a match with the weighted score, confidence, and per-level scores
-
isLikelyMatch
public boolean isLikelyMatch(FingerprintMatch match, double threshold)
Decides whether a match is likely, requiring the given score threshold and confidence at least 0.5.- Parameters:
match- the match to testthreshold- the minimum acceptable score- Returns:
- true if the match clears both thresholds
-
isDefiniteMatch
public boolean isDefiniteMatch(FingerprintMatch match)
Decides whether a match is near-certain, requiring score at least 0.95 and confidence at least 0.8.- Parameters:
match- the match to test- Returns:
- true if the match clears both fixed thresholds
-
-