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:
Source code:
main
Belongs to CDK module:
standard
  • Constructor Details

    • IntArrayCountFingerprint

      public IntArrayCountFingerprint()
    • IntArrayCountFingerprint

      public IntArrayCountFingerprint(Map<String,Integer> rawFingerprint)
    • IntArrayCountFingerprint

      public 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.
      Parameters:
      rawFingerprint - the raw fp
      behaveAsBitFingerprint - whether to behave as binary fp or not
  • Method Details

    • size

      public long size()
      Description copied from interface: ICountFingerprint
      Returns the number of bits of this fingerprint.
      Specified by:
      size in interface ICountFingerprint
      Returns:
      the size of the fingerprint.
    • getCount

      public int getCount(int index)
      Description copied from interface: ICountFingerprint
      Returns the count value for the bin with the given index.
      Specified by:
      getCount in interface ICountFingerprint
      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: ICountFingerprint
      Returns the hash corresponding to the given index in the fingerprint.
      Specified by:
      getHash in interface ICountFingerprint
      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: ICountFingerprint
      Returns the number of bins that are populated. This number is typically smaller then the total number of bins.
      Specified by:
      numOfPopulatedbins in interface ICountFingerprint
      Returns:
      the number of populated bins
      See Also:
    • merge

      public void merge(ICountFingerprint fp)
      Description copied from interface: ICountFingerprint
      Merge all from fp into the current fingerprint.
      Specified by:
      merge in interface ICountFingerprint
      Parameters:
      fp - to be merged
    • setBehaveAsBitFingerprint

      public void setBehaveAsBitFingerprint(boolean behaveAsBitFingerprint)
      Description copied from interface: ICountFingerprint
      Changes behaviour, if true is given the count fingerprint will behave as a bit fingerprint and return 0 or 1 for counts.
      Specified by:
      setBehaveAsBitFingerprint in interface ICountFingerprint
    • hasHash

      public boolean hasHash(int hash)
      Description copied from interface: ICountFingerprint
      Whether the fingerprint contains the given hash.
      Specified by:
      hasHash in interface ICountFingerprint
      Returns:
      true if the fingerprint contains the given hash, otherwise false.
    • getCountForHash

      public int getCountForHash(int hash)
      Description copied from interface: ICountFingerprint
      Get the number of times a certain hash exists in the fingerprint.
      Specified by:
      getCountForHash in interface ICountFingerprint
      Returns:
      the number associated with the given hash