Class HashCode


  • @PublicAPI
    public final class HashCode
    extends Object
    Hash code generator for molecules. Explicit hydrogens are not considered.
    NOTE: this class is not thread safe for the sake of efficiency, multiple threads should use multiple instances.
    Since:
    JChem 3.0
    • Field Detail

      • DEFAULT_RECURSION_LEVEL

        public static final int DEFAULT_RECURSION_LEVEL
        See Also:
        Constant Field Values
    • Constructor Detail

      • HashCode

        public HashCode()
        Creates a new instance of HashCode
    • Method Detail

      • getHashCode

        public int getHashCode​(Molecule mol,
                               int recursion)
        Gets the hash code.
        Parameters:
        mol - the molecule
        recursion - the maximum level of recursion. Increase for better diversity, decrease for speed. Specify 1 or more.
        Returns:
        the hash code
        See Also:
        DEFAULT_RECURSION_LEVEL
      • getHashCode

        public int getHashCode​(Molecule mol,
                               int[] fp,
                               int recursion)
        Gets the hash code.
        Parameters:
        mol - the molecule
        fp - the fingerprints in integers
        recursion - the maximum level of recursion. Increase for better diversity, decrease for speed. Specify 1 or more.
        Returns:
        the hash code
        See Also:
        DEFAULT_RECURSION_LEVEL