public class IntArrayCountFingerprint extends Object implements ICountFingerprint
Constructor and Description |
---|
IntArrayCountFingerprint() |
IntArrayCountFingerprint(Map<String,Integer> rawFingerprint) |
IntArrayCountFingerprint(Map<String,Integer> rawFingerprint,
boolean behaveAsBitFingerprint)
Create an
IntArrayCountFingerprint from a rawFingerprint
and if behaveAsBitFingerprint make it only return 0 or 1
as count thus behaving like a bit finger print. |
Modifier and Type | Method and Description |
---|---|
int |
getCount(int index)
Returns the count value for the bin with the given index.
|
int |
getCountForHash(int hash)
Get the number of times a certain hash exists in the fingerprint.
|
int |
getHash(int index)
Returns the hash corresponding to the given index in the fingerprint.
|
boolean |
hasHash(int hash)
Whether the fingerprint contains the given hash.
|
void |
merge(ICountFingerprint fp)
Merge all from
fp into the current fingerprint. |
int |
numOfPopulatedbins()
Returns the number of bins that are populated.
|
void |
setBehaveAsBitFingerprint(boolean behaveAsBitFingerprint)
Changes behaviour, if true is given the count fingerprint will
behave as a bit fingerprint and return 0 or 1 for counts.
|
long |
size()
Returns the number of bits of this fingerprint.
|
public IntArrayCountFingerprint()
public IntArrayCountFingerprint(Map<String,Integer> rawFingerprint, boolean behaveAsBitFingerprint)
IntArrayCountFingerprint
from a rawFingerprint
and if behaveAsBitFingerprint
make it only return 0 or 1
as count thus behaving like a bit finger print.rawFingerprint
- the raw fpbehaveAsBitFingerprint
- whether to behave as binary fp or notpublic long size()
ICountFingerprint
size
in interface ICountFingerprint
public int getCount(int index)
ICountFingerprint
getCount
in interface ICountFingerprint
index
- the index of the bin to return the number of hits for.public int getHash(int index)
ICountFingerprint
getHash
in interface ICountFingerprint
index
- the index of the bin to return the hash for.public int numOfPopulatedbins()
ICountFingerprint
numOfPopulatedbins
in interface ICountFingerprint
ICountFingerprint.size()
public void merge(ICountFingerprint fp)
ICountFingerprint
fp
into the current fingerprint.merge
in interface ICountFingerprint
fp
- to be mergedpublic void setBehaveAsBitFingerprint(boolean behaveAsBitFingerprint)
ICountFingerprint
setBehaveAsBitFingerprint
in interface ICountFingerprint
public boolean hasHash(int hash)
ICountFingerprint
hasHash
in interface ICountFingerprint
public int getCountForHash(int hash)
ICountFingerprint
getCountForHash
in interface ICountFingerprint
Copyright © 2021. All rights reserved.