Package org.openscience.cdk.fingerprint
Class IntArrayCountFingerprint
- java.lang.Object
-
- org.openscience.cdk.fingerprint.IntArrayCountFingerprint
-
- All Implemented Interfaces:
Serializable,ICountFingerprint
public class IntArrayCountFingerprint extends Object implements ICountFingerprint
- Author:
- jonalv
- See Also:
- Serialized Form
- Source code:
- main
- Belongs to CDK module:
- standard
-
-
Constructor Summary
Constructors Constructor Description IntArrayCountFingerprint()IntArrayCountFingerprint(Map<String,Integer> rawFingerprint)IntArrayCountFingerprint(Map<String,Integer> rawFingerprint, boolean behaveAsBitFingerprint)Create anIntArrayCountFingerprintfrom a rawFingerprint and ifbehaveAsBitFingerprintmake it only return 0 or 1 as count thus behaving like a bit finger print.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCount(int index)Returns the count value for the bin with the given index.intgetCountForHash(int hash)Get the number of times a certain hash exists in the fingerprint.intgetHash(int index)Returns the hash corresponding to the given index in the fingerprint.booleanhasHash(int hash)Whether the fingerprint contains the given hash.voidmerge(ICountFingerprint fp)Merge all fromfpinto the current fingerprint.intnumOfPopulatedbins()Returns the number of bins that are populated.voidsetBehaveAsBitFingerprint(boolean behaveAsBitFingerprint)Changes behaviour, if true is given the count fingerprint will behave as a bit fingerprint and return 0 or 1 for counts.longsize()Returns the number of bits of this fingerprint.
-
-
-
Constructor Detail
-
IntArrayCountFingerprint
public IntArrayCountFingerprint()
-
IntArrayCountFingerprint
public IntArrayCountFingerprint(Map<String,Integer> rawFingerprint, boolean behaveAsBitFingerprint)
Create anIntArrayCountFingerprintfrom a rawFingerprint and ifbehaveAsBitFingerprintmake it only return 0 or 1 as count thus behaving like a bit finger print.- Parameters:
rawFingerprint- the raw fpbehaveAsBitFingerprint- whether to behave as binary fp or not
-
-
Method Detail
-
size
public long size()
Description copied from interface:ICountFingerprintReturns the number of bits of this fingerprint.- Specified by:
sizein interfaceICountFingerprint- Returns:
- the size of the fingerprint.
-
getCount
public int getCount(int index)
Description copied from interface:ICountFingerprintReturns the count value for the bin with the given index.- Specified by:
getCountin interfaceICountFingerprint- Parameters:
index- the index of the bin to return the number of hits for.- Returns:
- the count for the bin with given index.
-
getHash
public int getHash(int index)
Description copied from interface:ICountFingerprintReturns the hash corresponding to the given index in the fingerprint.- Specified by:
getHashin interfaceICountFingerprint- Parameters:
index- the index of the bin to return the hash for.- Returns:
- the hash for the bin with the given index.
-
numOfPopulatedbins
public int numOfPopulatedbins()
Description copied from interface:ICountFingerprintReturns the number of bins that are populated. This number is typically smaller then the total number of bins.- Specified by:
numOfPopulatedbinsin interfaceICountFingerprint- Returns:
- the number of populated bins
- See Also:
ICountFingerprint.size()
-
merge
public void merge(ICountFingerprint fp)
Description copied from interface:ICountFingerprintMerge all fromfpinto the current fingerprint.- Specified by:
mergein interfaceICountFingerprint- Parameters:
fp- to be merged
-
setBehaveAsBitFingerprint
public void setBehaveAsBitFingerprint(boolean behaveAsBitFingerprint)
Description copied from interface:ICountFingerprintChanges behaviour, if true is given the count fingerprint will behave as a bit fingerprint and return 0 or 1 for counts.- Specified by:
setBehaveAsBitFingerprintin interfaceICountFingerprint
-
hasHash
public boolean hasHash(int hash)
Description copied from interface:ICountFingerprintWhether the fingerprint contains the given hash.- Specified by:
hasHashin interfaceICountFingerprint- Returns:
- true if the fingerprint contains the given hash, otherwise false.
-
getCountForHash
public int getCountForHash(int hash)
Description copied from interface:ICountFingerprintGet the number of times a certain hash exists in the fingerprint.- Specified by:
getCountForHashin interfaceICountFingerprint- Returns:
- the number associated with the given hash
-
-