Package com.tonic.analysis.fingerprint
Class MethodFingerprint
- java.lang.Object
-
- com.tonic.analysis.fingerprint.MethodFingerprint
-
public class MethodFingerprint extends Object
A method's identity fingerprint: three feature levels with precomputed hashes and an availability mask.
-
-
Constructor Summary
Constructors Constructor Description MethodFingerprint(String methodId, Level0Features l0, Level1Features l1, Level2Features l2)Creates a fingerprint and precomputes the hash of each valid level.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAvailableLevelsCount()intgetAvailableLevelsMask()byte[]getHash(FingerprintLevel level)Level0FeaturesgetLevel0()Level1FeaturesgetLevel1()Level2FeaturesgetLevel2()StringgetMethodId()booleanhasLevel(FingerprintLevel level)StringtoString()
-
-
-
Constructor Detail
-
MethodFingerprint
public MethodFingerprint(String methodId, Level0Features l0, Level1Features l1, Level2Features l2)
Creates a fingerprint and precomputes the hash of each valid level.- Parameters:
methodId- the identifier of the fingerprinted methodl0- the ultra-stable features, may be nulll1- the stable features, may be nulll2- the detailed features, may be null
-
-
Method Detail
-
getHash
public byte[] getHash(FingerprintLevel level)
- Parameters:
level- the fingerprint level to read- Returns:
- the precomputed hash for that level, or null if the level is unavailable
-
hasLevel
public boolean hasLevel(FingerprintLevel level)
- Parameters:
level- the fingerprint level to test- Returns:
- true if a hash was computed for that level
-
getMethodId
public String getMethodId()
- Returns:
- the method id
-
getLevel0
public Level0Features getLevel0()
- Returns:
- the level0
-
getLevel1
public Level1Features getLevel1()
- Returns:
- the level1
-
getLevel2
public Level2Features getLevel2()
- Returns:
- the level2
-
getAvailableLevelsMask
public int getAvailableLevelsMask()
- Returns:
- the available levels mask
-
getAvailableLevelsCount
public int getAvailableLevelsCount()
- Returns:
- the number of levels with valid features
-
-