Interface StructureSearchDataSource


  • public interface StructureSearchDataSource
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      long getBackboneCode​(int row, boolean largestFragmentOnly)
      Returns a hash code representing the structure or its largest fragment without stereo information and with all unsaturated bonds converted to single bonds.
      java.lang.Object getDescriptor​(int column, int row, boolean largestFragmentOnly)  
      int getDescriptorColumn​(java.lang.String descriptorShortName)
      Returns a number to be used in getDescriptor() to address the the descriptor with the given short name.
      byte[] getIDCode​(int row, boolean largestFragmentOnly)
      Returns the idcode of the structure or largest fragment.
      long getNoStereoCode​(int row, boolean largestFragmentOnly)
      Returns a hash code representing the structure or its largest fragment without any stereo information.
      long getNoStereoTautomerCode​(int row, boolean largestFragmentOnly)
      Returns a hash code representing the generic tautomer of the structure or its largest fragment with the stereo information removed before creating the generic tautomer.
      int getRowCount()
      This is the total number of records, whether they qualify for a structure search or not.
      long getTautomerCode​(int row, boolean largestFragmentOnly)
      Returns a hash code representing the generic tautomer of the structure or its largest fragment.
      boolean isSupportedSearchType​(StructureSearchSpecification specification)
      Returns true if idcodes and/or hash codes for this particular search specification are directly available by the source, i.e.
    • Field Detail

    • Method Detail

      • isSupportedSearchType

        boolean isSupportedSearchType​(StructureSearchSpecification specification)
        Returns true if idcodes and/or hash codes for this particular search specification are directly available by the source, i.e. without calculating idcodes, descriptors or hash codes on-the-fly. In case of search types other than substructure search the implementation needs to check specification.isLargestFragmentOnly(). In case of similarity searches the implementation needs to consider specification.getDescriptorShortName().
        Parameters:
        specification -
        Returns:
      • getRowCount

        int getRowCount()
        This is the total number of records, whether they qualify for a structure search or not.
        Returns:
      • getDescriptorColumn

        int getDescriptorColumn​(java.lang.String descriptorShortName)
        Returns a number to be used in getDescriptor() to address the the descriptor with the given short name. If a descriptor of the desired kind is not available, then return -1 as indication that it needs to be generated on-the-fly.
        Parameters:
        descriptorShortName -
        Returns:
        descriptor column or -1, if the descriptor is not available
      • getDescriptor

        java.lang.Object getDescriptor​(int column,
                                       int row,
                                       boolean largestFragmentOnly)
        Parameters:
        column -
        row -
        largestFragmentOnly -
        Returns:
        null if this row has no descriptor
      • getIDCode

        byte[] getIDCode​(int row,
                         boolean largestFragmentOnly)
        Returns the idcode of the structure or largest fragment. If the code is not available, null is returned. This method is not supposed to calculate idcodes on-the-fly.
        Parameters:
        row -
        largestFragmentOnly -
        Returns:
        idcode of this row or null, if no structure is associated to this row
      • getNoStereoCode

        long getNoStereoCode​(int row,
                             boolean largestFragmentOnly)
        Returns a hash code representing the structure or its largest fragment without any stereo information. If this code is not available, SEARCH_TYPE_NOT_SUPPORTED is returned. This method is not supposed to calculate the code on-the-fly.
        Parameters:
        row -
        largestFragmentOnly -
        Returns:
      • getTautomerCode

        long getTautomerCode​(int row,
                             boolean largestFragmentOnly)
        Returns a hash code representing the generic tautomer of the structure or its largest fragment. If this code is not available, SEARCH_TYPE_NOT_SUPPORTED is returned. This method is not supposed to calculate the code on-the-fly.
        Parameters:
        row -
        largestFragmentOnly -
        Returns:
      • getNoStereoTautomerCode

        long getNoStereoTautomerCode​(int row,
                                     boolean largestFragmentOnly)
        Returns a hash code representing the generic tautomer of the structure or its largest fragment with the stereo information removed before creating the generic tautomer. If this code is not available, SEARCH_TYPE_NOT_SUPPORTED is returned. This method is not supposed to calculate the code on-the-fly.
        Parameters:
        row -
        largestFragmentOnly -
        Returns:
      • getBackboneCode

        long getBackboneCode​(int row,
                             boolean largestFragmentOnly)
        Returns a hash code representing the structure or its largest fragment without stereo information and with all unsaturated bonds converted to single bonds. SEARCH_TYPE_NOT_SUPPORTED is returned. This method is not supposed to calculate the code on-the-fly.
        Parameters:
        row -
        largestFragmentOnly -
        Returns: