chemaxon.jchem.db
Class JChemSearch

java.lang.Object
  extended by chemaxon.util.ErrorHandler
      extended by chemaxon.jchem.db.JChemSearch
All Implemented Interfaces:
TableTypeConstants, chemaxon.license.Licensable, SearchConstants, java.io.Serializable

public class JChemSearch
extends ErrorHandler
implements java.io.Serializable, SearchConstants, TableTypeConstants, chemaxon.license.Licensable

JavaBean for structure searching in structure tables of relational databases.

Example for using the class:

    searcher = new JChemSearch();
    searcher.setQueryStructure("c1cnccc1Cl");
    searcher.setConnectionHandler(conHandler);
    searcher.setStructureTable("cduser.structures");
    
    searchOptions = new JChemSearchOptions();
    searchOptions.setSearchType(JChemSearch.SIMILARITY);
    searchOptions.setDissimilarityThreshold(0.8);
    searchOptions.setMaxResultCount(100);
    searchOptions.setMaxTime(60000);
    searcher.setSearchOptions(searchOptions);
    
    searcher.setRunMode(JChemSearch.RUN_MODE_SYNCH_COMPLETE);
    searcher.run();
 

Author:
Ferenc Csizmadia, Szilard Dorant
See Also:
Serialized Form

Nested Class Summary
static class JChemSearch.DissimilarityMetrics
          Class for presenting the available dissimilarity metrics for similarity search.
 
Field Summary
static int APPEND_TO_RESULT_TABLE
          Constant for the generation of result tables.
static int CREATE_OR_REPLACE_RESULT_TABLE
          Constant for the generation of result tables.
static int NO_ORDERING
          Constant for ordering the result.
static int NO_RESULT_TABLE
          Constant for the generation of result tables.
static int ORDERING_BY_FILTER_ID_LIST
          Constant for ordering the result.
static int ORDERING_BY_ID
          Constant for ordering the result.
static int ORDERING_BY_ID_OR_SIMILARITY
          Constant for ordering the result.
static int RUN_MODE_ASYNCH_COMPLETE
          Runs the search in a new thread; run() or setRunning(boolean) return immediately.
static int RUN_MODE_ASYNCH_PROGRESSIVE
          Runs the search in a new thread; run() or setRunning(boolean) return immediately.
static int RUN_MODE_SYNCH_COMPLETE
          The "runner" methods (run() or setRunning(boolean) return only after all hits has been found.
 
Fields inherited from class chemaxon.util.ErrorHandler
CLASS_NOT_FOUND_ERROR, DATABASE_SEARCH_ERROR, exception, ILLEGAL_ACCESS_ERROR, INSTANTIATION_ERROR, IO_ERROR, MAX_SEARCH_FREQUENCY_EXCEEDED_ERROR, MOL_FORMAT_ERROR, NO_ERROR, PROPERTY_NOT_SET_ERROR, SQL_ERROR, UNIDENTIFIED_ERROR
 
Fields inherited from interface chemaxon.sss.SearchConstants
ABS_STEREO_ALWAYS_ON, ABS_STEREO_CHIRAL_FLAG, ABS_STEREO_TABLE_OPTION, ATTACHED_DATA_MATCH_EXACT, ATTACHED_DATA_MATCH_GENERAL, ATTACHED_DATA_MATCH_IGNORE, CHARGE_MATCHING_DEFAULT, CHARGE_MATCHING_EXACT, CHARGE_MATCHING_IGNORE, DEFAULT_DISSIMILARITY_THRESHOLD, DEFAULT_SIMILARITY_THRESHOLD, DISSIMILARITY, DUPLICATE, EXACT, EXACT_FRAGMENT, EXACT_FRAGMENT_OFF, EXACT_FRAGMENT_ON, FULL, FULL_FRAGMENT, HCOUNT_MATCHING_AUTO, HCOUNT_MATCHING_EQUAL, HCOUNT_MATCHING_GREATER_OR_EQUAL, IMPLICIT_H_MATCHING_DEFAULT, IMPLICIT_H_MATCHING_DISABLED, IMPLICIT_H_MATCHING_ENABLED, ISOTOPE_MATCHING_DEFAULT, ISOTOPE_MATCHING_EXACT, ISOTOPE_MATCHING_IGNORE, KEEP_QUERY_ORDER, MARKUSH_AROM_FINAL_CHECK, MARKUSH_AROM_NO_FINAL_CHECK, MARKUSH_AROM_OFF, MARKUSH_DISABLED, MARKUSH_ENABLED, MARKUSH_HIT_INNER, MARKUSH_HIT_ORIGINAL, MATCH_COUNT_BETWEEN, MATCH_COUNT_RELATION, MIX_SGROUP_MATCHING_OFF, MIX_SGROUP_MATCHING_ON, NO_ABAS, NO_SCREEN, OPTION_CHARGE_MATCHING, OPTION_EXACT_FRAGMENT, OPTION_ISOTOPE_MATCHING, OPTION_KEEP_QUERY_ORDER, OPTION_MARKUSH_AROM, OPTION_MARKUSH_ENABLED, OPTION_MARKUSH_HIT, OPTION_MIX_SGROUP_MATCHING, OPTION_RADICAL_MATCHING, OPTION_STEREO_MODEL, OPTION_TAUTOMER_SEARCH, OPTION_VAGUE_BOND, OPTION_VALENCE_MATCHING, PERFECT, R_NODE_PLACEHOLDER, RADICAL_MATCHING_DEFAULT, RADICAL_MATCHING_EXACT, RADICAL_MATCHING_IGNORE, REARRANGE_QUERY, SEARCH_MODE_NAMES, SEARCH_OPTIONS_LENGTH, SIMILARITY, STEREO_DIASTEREOMER, STEREO_EXACT, STEREO_IGNORE, STEREO_MODEL_COMPREHENSIVE, STEREO_MODEL_DEFAULT, STEREO_MODEL_GLOBAL, STEREO_MODEL_LOCAL, STEREO_SPECIFIC, SUBSTRUCTURE, SUPERSTRUCTURE, TAUTOMER_SEARCH_OFF, TAUTOMER_SEARCH_ON, UNDEF_R_MATCHING_ALL, UNDEF_R_MATCHING_GROUP, UNDEF_R_MATCHING_UNDEF_R, VAGUE_BOND_DEFAULT, VAGUE_BOND_LEVEL1, VAGUE_BOND_LEVEL2, VAGUE_BOND_LEVEL3, VAGUE_BOND_LEVEL4, VAGUE_BOND_OFF, VALENCE_MATCHING_IGNORE, VALENCE_MATCHING_ON
 
Fields inherited from interface chemaxon.jchem.db.TableTypeConstants
FP_DEFAULT_BITS_PER_PATTERN, FP_DEFAULT_LENGTH_IN_INTS, FP_DEFAULT_PATTERN_LENGTH, MYSQL_DEFAULT_TABLE_TYPE, MYSQL_FORCE_INNO_DB, MYSQL_FORCE_MYISAM, TABLE_TYPE_ANY_STRUCTURES, TABLE_TYPE_DEFAULT, TABLE_TYPE_EXPLANATIONS, TABLE_TYPE_IS_NOT_SUPPORTED, TABLE_TYPE_MARKUSH_LIBRARIES, TABLE_TYPE_MOLECULES, TABLE_TYPE_NAMES, TABLE_TYPE_QUERY_STRUCTURES, TABLE_TYPE_REACTIONS
 
Constructor Summary
JChemSearch()
          Creates new JChemSearch class
JChemSearch(java.lang.String indexedTable, java.lang.String indexedColumn)
          For internal use only.
 
Method Summary
 void cleanResults()
          Cleans stored search results.
static void clearCache()
          Clears the cache that stores fingerprints and structures.
 int getAbsoluteStereo()
          Deprecated. since JChem 5.0. use JChemSearchOptions.getAbsoluteStereo() instead
 int[] getAvailableNewHits(int arraySize)
          Used with run mode = RUN_MODE_ASYNCH_PROGRESSIVE.
 java.util.Hashtable getCachedTables()
          Gets the names and sizes of tables currently in the cache.
 java.lang.String getCacheError()
          For checking for cache errors.
 java.sql.Connection getConnection()
          Getter for property connection.
 ConnectionHandler getConnectionHandler()
          Getter for property connectionHandler.
 int getCurrentId()
          Getter for property currentId.
 float[] getDissimilarity()
          Getter for dissimilarity results.
 float getDissimilarity(int index)
          Indexed getter for property dissimilarity.
static JChemSearch.DissimilarityMetrics getDissimilarityMetrics(ConnectionHandler ch, java.lang.String tableName)
          Returns the available dissimilarity metrics for the given table.
 float getDissimilarityThreshold()
          Deprecated. since JChem 5.0. Use JChemSearchOptions.getDissimilarityThreshold() instead
 int getDoubleBondStereoMatchingMode()
          Deprecated. since JChem 5.0. use SearchOptions.getDoubleBondStereoMatchingMode() instead
 java.lang.Throwable getException()
          Getter for property exception.
 java.lang.String getFilter()
          Deprecated. Since 5.0 Use SearchOptions.getChemTermsFilter() instead.
 java.lang.String getFilterConfigFileName()
          Deprecated. Since 5.0 Use SearchOptions.getChemTermsFilterConfig() instead.
 java.lang.String getFilterQuery()
          Deprecated. since JChem 5.0. use JChemSearchOptions.getFilterQuery() instead
 int getHCountMatching()
          Deprecated. since JChem 5.0. use SearchOptions.getHCountMatching() instead
 Molecule[] getHitsAsMolecules(int[] idList, HitColoringAndAlignmentOptions options, java.util.ArrayList dataFieldNames, java.util.ArrayList dataFieldValues)
          Returns hits ready for display.
 int getMaxResultCount()
          Deprecated. since JChem 5.0. use JChemSearchOptions.getMaxResultCount() instead
 long getMaxTime()
          Deprecated. since JChem 5.0. use JChemSearchOptions.getMaxTime() instead
 int getNextHit()
          Used with run mode = RUN_MODE_ASYNCH_PROGRESSIVE.
 int getOption(int option)
          Deprecated. since 5.0, use getters in
  • see getSearchOptions()
  • see SearchOptions
  • see JChemSearchOptions
  •  int getOrder()
              Getter for property order.
     java.lang.String getProgressMessage()
              Getter for property progressMessage.
     java.lang.String getQueryStructure()
              Getter for property queryStructure.
     int getResult(int index)
              Indexed getter for property results.
     int getResultCount()
              Getter for property resultCount.
     int[] getResults()
              Returns an int array containing the cd_id values of found compounds.
     java.lang.String getResultTable()
              Getter for property resultTable.
     int getResultTableMode()
              Getter for property resultTableMode.
     int getRunMode()
              Retruns the current run mode.
     int getScreenedCount()
              Gets the number of screeened structures.
     long getScreeningTime()
              Gets the screening time.
     JChemSearchOptions getSearchOptions()
              Returns the SearchOptions object associated with this Search object.
     long getSearchTime()
              Gets the total search time.
     int getSearchType()
              Deprecated. since JChem 5.0 use SearchOptions.getSearchType() instead
     java.lang.String getStructureTable()
              Getter for property structureTable.
     boolean getTautomerSearch()
              Deprecated. since JChem 5.0. use SearchOptions.isTautomerSearch() instead
     int getTimeout()
              Gets the current timout setting.
     int getVagueBondLevel()
              Deprecated. since JChem 5.0. use SearchOptions.getVagueBondLevel() instead
     boolean hasMoreHits()
              Used with run mode = RUN_MODE_ASYNCH_PROGRESSIVE.
     boolean isExactQueryAtomMatching()
              Deprecated. since JChem 5.0. use SearchOptions.isExactQueryAtomMatching() instead
     boolean isExactStereoMatching()
              Deprecated. since JChem 5.0. use SearchOptions.isExactStereoMatching() instead
     boolean isInfoToStdError()
              Getter for property infoToStdError.
     boolean isLicensed()
              Returns information about the licensing of the product.
     boolean isMaxResultCountReached()
              Getter for property maxResultCountReached.
     boolean isMaxTimeReached()
              Getter for property maxTimeReached.
     boolean isRunning()
              Getter for property running.
     boolean isStereoSearch()
              Deprecated. since JChem 5.0. use SearchOptions.isStereoSearch() instead
     boolean isStructureCaching()
              Getter for property structureCaching.
     boolean isWaitingForResult()
              Deprecated. Replaced by getRunMode().
     void run_NE()
              Deprecated. since JChem 5.2 use run()
     void run()
              Starts searching.
     void setAbsoluteStereo(int absoluteStereo)
              Deprecated. since JChem 5.0. use JChemSearchOptions.setAbsoluteStereo(int) instead
     void setCacheExpirationTime(double hours)
              Sets the expiration time for the structure cache.
     void setConnectionHandler(ConnectionHandler connectionHandler)
              Sets the database connection.
     void setDescriptorConfig(java.lang.String descriptorConfig)
              Deprecated. since JChem 5.0 use JChemSearchOptions.setDescriptorConfig(String) instead
     void setDescriptorName(java.lang.String descriptorName)
              Deprecated. since JChem 5.0 use JChemSearchOptions.setDescriptorName(String) instead
     void setDissimilarityMetric(java.lang.String dissimilarityMetric)
              Deprecated. since JChem 5.0. Use JChemSearchOptions.setDissimilarityMetric(String) instead
     void setDissimilarityThreshold(float dissimilarityThreshold)
              Deprecated. since JChem 5.0. Use JChemSearchOptions.setDissimilarityThreshold(float) instead
     void setDoubleBondStereoMatchingMode(int mode)
              Deprecated. since JChem 5.0. use SearchOptions.setDoubleBondStereoMatchingMode(int) instead
     void setExactQueryAtomMatching(boolean exactQueryAtomMatching)
              Deprecated. since JChem 5.0. use SearchOptions.setExactQueryAtomMatching(boolean) instead
     void setExactStereoMatching(boolean exactStereoMatching)
              Deprecated. since JChem 5.0. use SearchOptions.setExactStereoMatching(boolean) instead
     void setFilter(java.lang.String filterExpression)
              Deprecated. Since 5.0 Use SearchOptions.setChemTermsFilter(String) instead.
     void setFilterConfigFileName(java.lang.String fileName)
              Deprecated. Since 5.0 Use SearchOptions.setChemTermsFilterConfig(String) instead, using the content of the file as parameter.
     void setFilterIDList(int[] ids)
              Specifies a list of cd_id's that are allowed to be included in the result set.
     void setFilterIDNotList(int[] ids)
              Specifies a list of cd_id's that should not to be included in the result set.
     void setFilterQuery(java.lang.String filterQuery)
              Deprecated. since JChem 5.0 use JChemSearchOptions.setFilterQuery(String)
     void setHCountMatching(int HCountMatching)
              Deprecated. since JChem 5.0. use SearchOptions.setHCountMatching(int) instead
     void setInfoToStdError(boolean infoToStdError)
              Setter for property infoToStdError.
     void setLicenseEnvironment(java.lang.String env)
              Every license can have a modifier environment that's typically an integration environment.
     void setMatchCountBetween(int hitLimitLow, boolean isLowerLimitIncluded, int hitLimitHigh, boolean isHigherLimitIncluded)
              Deprecated. since JChem 5.0 use JChemSearchOptions.setMatchCountOptions(MatchCountOptions) instead
     void setMatchCountInRelation(java.lang.String relation, int hitLimit)
              Deprecated. since JChem 5.0 use JChemSearchOptions.setMatchCountOptions(MatchCountOptions) instead
     void setMaxCacheSize(int maxCacheSizeMB)
              Sets the desired cache memory allocation policy.
     void setMaxResultCount(int maxResultCount)
              Deprecated. since JChem 5.0. use JChemSearchOptions.setMaxResultCount(int) instead
     void setMaxTime(long maxTime)
              Deprecated. since JChem 5.0. use JChemSearchOptions.setMaxTime(long) instead
     void setMinNonCachedMemory(int minNonCachedMemoryMB)
              Sets the desired cache memory allocation policy.
     void setNumberOfProcessingThreads(int threads)
              Sets the number of processing threads.
     void setOption(int option, int value)
              Deprecated. since 5.0, use setters in SearchOptions
  • see getSearchOptions()
  • see SearchOptions
  • see JChemSearchOptions
  •  void setOrder(int order)
              Setter for property order.
     void setQueryStructure(Molecule queryMol)
              Sets the query structure.
     void setQueryStructure(java.lang.String queryStructure)
              Setter for property queryStructure.
     void setRegCode(long code)
              Sets the registration code.
     void setResultTable(java.lang.String resultTable)
              Setter for property resultTable.
     void setResultTableMode(int resultTableMode)
              Setter for property resultTableMode.
     void setReturnsNonHits(boolean value)
              Deprecated. since JChem 5.0 use JChemSearchOptions.setReturnsNonHits(boolean) instead
     void setRunMode(int runMode)
              Specifies whether the search is performed synchronously or asychronously and if performed asynchronously, whether the hits can be obtained as soon as they are found or only after the search has completed.
     void setRunning(boolean run)
              Setter for property running.
     void setSearchOptions(JChemSearchOptions options)
              Sets search parameters.
     void setSearchType(int searchType)
              Deprecated. since JChem 5.0 use SearchOptions.setSearchType(int) instead
     void setStereoSearch(boolean stereoSearch)
              Deprecated. since JChem 5.0. use SearchOptions.setStereoSearch(boolean) instead
     void setStructureTable(java.lang.String structureTable)
              Setter for property structureTable.
     void setTautomerSearch(boolean value)
              Deprecated. since JChem 5.0. use SearchOptions.setTautomerSearch(boolean) instead
     void setThreadPriority(int priority)
              Sets the priority of the processing threads.
     void setTimeout(int seconds)
              Sets the timeout value in seconds.
     void setVagueBondLevel(int level)
              Deprecated. since JChem 5.0. use SearchOptions.setVagueBondLevel(int) instead
     void setWaitingForResult(boolean waitingForResult)
              Deprecated. replaced by setRunMode(int).
     void waitUntilSearchComplete()
              Used with run mode = RUN_MODE_ASYNCH_PROGRESSIVE.
     
    Methods inherited from class chemaxon.util.ErrorHandler
    checkError, checkException, getError, getErrorMessage, getStackTrace
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    NO_RESULT_TABLE

    public static final int NO_RESULT_TABLE
    Constant for the generation of result tables. Meaning: Don't store the results in a table. (Value=0)

    See Also:
    Constant Field Values

    CREATE_OR_REPLACE_RESULT_TABLE

    public static final int CREATE_OR_REPLACE_RESULT_TABLE
    Constant for the generation of result tables. Meaning: Create a result table. If a table with same name exists, replace it with the new one. (Value=2)

    See Also:
    Constant Field Values

    APPEND_TO_RESULT_TABLE

    public static final int APPEND_TO_RESULT_TABLE
    Constant for the generation of result tables. Meaning: Append to an existing result table. Create a new one if it doesn't exist (Value=3)

    See Also:
    Constant Field Values

    NO_ORDERING

    public static final int NO_ORDERING
    Constant for ordering the result. Meaning: Don't order the result (Value=0)

    See Also:
    Constant Field Values

    ORDERING_BY_ID

    public static final int ORDERING_BY_ID
    Constant for ordering the result. Meaning: Order the result according to the cd_id values (Value=1)

    See Also:
    Constant Field Values

    ORDERING_BY_ID_OR_SIMILARITY

    public static final int ORDERING_BY_ID_OR_SIMILARITY
    Constant for ordering the result. Meaning: Order the result according to the calculated dissimilarity in the case of dissimilarity searching, use the cd_id values otherwise (Value=2)

    See Also:
    Constant Field Values

    ORDERING_BY_FILTER_ID_LIST

    public static final int ORDERING_BY_FILTER_ID_LIST
    Constant for ordering the result. Meaning: Order the result according to the filterIDList

    See Also:
    Constant Field Values

    RUN_MODE_SYNCH_COMPLETE

    public static int RUN_MODE_SYNCH_COMPLETE
    The "runner" methods (run() or setRunning(boolean) return only after all hits has been found. (Corresponds to calling setWaitingForResult(boolean) with true.)

    Since:
    JChem 5.0

    RUN_MODE_ASYNCH_COMPLETE

    public static int RUN_MODE_ASYNCH_COMPLETE
    Runs the search in a new thread; run() or setRunning(boolean) return immediately. (Corresponds to calling setWaitingForResult(boolean) with false)

    Since:
    JChem 5.0

    RUN_MODE_ASYNCH_PROGRESSIVE

    public static int RUN_MODE_ASYNCH_PROGRESSIVE
    Runs the search in a new thread; run() or setRunning(boolean) return immediately. The methods hasMoreHits(), getNextHit() and getAvailableNewHits(int) can be used retrieve hits as soon as they become available.
    This mode doesn't support

    Since:
    JChem 5.0
    Constructor Detail

    JChemSearch

    public JChemSearch()
    Creates new JChemSearch class


    JChemSearch

    public JChemSearch(java.lang.String indexedTable,
                       java.lang.String indexedColumn)
    For internal use only.

    Method Detail

    getQueryStructure

    public java.lang.String getQueryStructure()
    Getter for property queryStructure.

    Returns:
    Value of property queryStructure.

    setQueryStructure

    public void setQueryStructure(java.lang.String queryStructure)
    Setter for property queryStructure. The query structure may be in MDL Molfile, Smiles or other format recognized by JChem. If the specified value is null or empty string, then the search returns all molecules.

    NOTE for Daylight formats: If search type is SearchConstants.DUPLICATE, SearchConstants.SUPERSTRUCTURE or SearchConstants.SIMILARITY, treats SMILES/SMARTS input strings as SMILES, otherwise as SMARTS.

    Parameters:
    queryStructure - New value of property queryStructure.

    setQueryStructure

    public void setQueryStructure(Molecule queryMol)
    Sets the query structure. If the specified value is null, then the search returns all molecules.

    Parameters:
    queryMol - the query structure.

    getStructureTable

    public java.lang.String getStructureTable()
    Getter for property structureTable.

    Returns:
    Value of property structureTable.

    setStructureTable

    public void setStructureTable(java.lang.String structureTable)
    Setter for property structureTable. It specifies the name of the table to be searched for structures containing the query.

    Parameters:
    structureTable - New value of property structureTable.

    getSearchType

    public int getSearchType()
    Deprecated. since JChem 5.0 use SearchOptions.getSearchType() instead

    Getter for property searchType.

    Returns:
    Value of property searchType.

    setSearchType

    public void setSearchType(int searchType)
    Deprecated. since JChem 5.0 use SearchOptions.setSearchType(int) instead

    Sets different search options according to a predefined search type. For full explanation see JChem Query Guide.
    Acceptable values: SearchConstants.NO_SCREEN, SearchConstants.NO_ABAS, SearchConstants.SUBSTRUCTURE (default), SearchConstants.SUPERSTRUCTURE (no query fetures allowed), SearchConstants.SIMILARITY, SearchConstants.FULL, SearchConstants.FULL_FRAGMENT and SearchConstants.DUPLICATE.

    WARNING: This method may affect other search settings, therefore if other search options are adjusted, this method should be called first! The following options are affected:

    Parameters:
    searchType - New value of property searchType.

    setOption

    public void setOption(int option,
                          int value)
    Deprecated. since 5.0, use setters in SearchOptions
  • see getSearchOptions()
  • see SearchOptions
  • see JChemSearchOptions
  • Setter for some advanced search options.

    Parameters:
    option - Option identifier to be set.
    value - Value of option to be set.
    The list of accepted option identifiers:
    Since:
    JChem 3.2

    getOption

    public int getOption(int option)
    Deprecated. since 5.0, use getters in
  • see getSearchOptions()
  • see SearchOptions
  • see JChemSearchOptions
  • Getter for some advanced search options.

    Parameters:
    option - Option identifier.
    The list of accepted identifiers:
    Returns:
    the setting of the given option
    Since:
    JChem 3.2

    getException

    public java.lang.Throwable getException()
    Getter for property exception. The ancestor's method is overloaded to allow handling exceptions occuring in the searching thread.

    Overrides:
    getException in class ErrorHandler
    Returns:
    Value of property exception.

    getCacheError

    public java.lang.String getCacheError()
    For checking for cache errors. Should be called after the search is finished.

    Returns:
    the error text, or null in case of normal execution.
    Since:
    JChem 3.0

    getCachedTables

    public java.util.Hashtable getCachedTables()
    Gets the names and sizes of tables currently in the cache.

    Returns:
    the names and allocated memory size in bytes as key - value (String - Long) pairs.
    Since:
    JChem 3.0

    getMaxTime

    public long getMaxTime()
    Deprecated. since JChem 5.0. use JChemSearchOptions.getMaxTime() instead

    Getter for property maxTime.

    Returns:
    Value of property maxTime.

    setMaxTime

    public void setMaxTime(long maxTime)
    Deprecated. since JChem 5.0. use JChemSearchOptions.setMaxTime(long) instead

    Setter for property maxTime. Sets the maximum amount of time in milliseconds, which is available for searching. If the time is passed searching stops. If maxTime is 0, then there is no limit. (Default: 0)

    Parameters:
    maxTime - New value of property maxTime.

    getMaxResultCount

    public int getMaxResultCount()
    Deprecated. since JChem 5.0. use JChemSearchOptions.getMaxResultCount() instead

    Getter for property maxResultCount.

    Returns:
    Value of property maxResultCount.

    setMaxResultCount

    public void setMaxResultCount(int maxResultCount)
    Deprecated. since JChem 5.0. use JChemSearchOptions.setMaxResultCount(int) instead

    Setter for property maxResultCount. Limits the number of molecules returned by the search to maxResultCount". This can save time when there would be too many results. If maxResultCount is 0, then there is no limit. (Default: 0)

    NOTE: The search will stop after the maximum result count is reached. This is also true for SIMILARITY searches: after the search has found the given number of compounds that falls below the specified similarity threshold, it stops and returns them. To find the n most similar structures in table, please set maxResultCount to 0 (unlimitied, default), and use the first n results with ordering set by setOrder(int) to ORDERING_BY_ID_OR_SIMILARITY.

    Parameters:
    maxResultCount - New value of property maxResultCount.

    getFilterQuery

    public java.lang.String getFilterQuery()
    Deprecated. since JChem 5.0. use JChemSearchOptions.getFilterQuery() instead

    Getter for property filterQuery

    Returns:
    Value of property filterQuery.
    Since:
    JChem 2.3

    setFilterQuery

    public void setFilterQuery(java.lang.String filterQuery)
    Deprecated. since JChem 5.0 use JChemSearchOptions.setFilterQuery(String)

    Setter for property filterQuery. SQL query for filtering. The result should contain the cd_id values. Example:
        searcher.setFilterQuery("select cd_id from mystructures where cd_id>1000");
     
    If the SELECT contains an "ORDER BY" clause, the results will be ordered accordingly, the setting for setOrder(int) will be ignored, except when an inverse hit list is requested.

    NOTE: The filtered cd_id values are cached. Invoke setFilterQuery again before the next search, if the filter needs to be refreshed.

    Parameters:
    filterQuery - New value of property filterQuery.
    Since:
    JChem 2.3

    setFilterIDList

    public void setFilterIDList(int[] ids)
    Specifies a list of cd_id's that are allowed to be included in the result set. Useful for narrowing the result of a previous search.

    Parameters:
    ids - the cd_id values in an array
    Since:
    JChem 3.1

    setFilterIDNotList

    public void setFilterIDNotList(int[] ids)
    Specifies a list of cd_id's that should not to be included in the result set.

    Parameters:
    ids - the cd_id values in an array
    Since:
    JChem 3.1.2

    getDissimilarityThreshold

    public float getDissimilarityThreshold()
    Deprecated. since JChem 5.0. Use JChemSearchOptions.getDissimilarityThreshold() instead

    Getter for property dissimilarityThreshold.

    Returns:
    Value of property dissimilarityThreshold.

    setDissimilarityThreshold

    public void setDissimilarityThreshold(float dissimilarityThreshold)
    Deprecated. since JChem 5.0. Use JChemSearchOptions.setDissimilarityThreshold(float) instead

    Setter for property dissimilarityThreshold. Sets the threshold for similarity searches. A lower threshold results less hits that are more similar to the query structure. (Default: 0.3)

    Parameters:
    dissimilarityThreshold - New value of property dissimilarityThreshold.

    setDissimilarityMetric

    public void setDissimilarityMetric(java.lang.String dissimilarityMetric)
    Deprecated. since JChem 5.0. Use JChemSearchOptions.setDissimilarityMetric(String) instead

    Sets the metric to be used during similarity search.

    Parameters:
    dissimilarityMetric - the name of the metric to be used. Specify null for the default metric.
    Since:
    JChem 3.2
    See Also:
    getDissimilarityMetrics(chemaxon.util.ConnectionHandler, String)

    getDissimilarityMetrics

    public static JChemSearch.DissimilarityMetrics getDissimilarityMetrics(ConnectionHandler ch,
                                                                           java.lang.String tableName)
                                                                    throws java.sql.SQLException
    Returns the available dissimilarity metrics for the given table.

    Parameters:
    ch - ConnaectionHandler with live connection
    tableName - the name of the JChem structure table
    Returns:
    the information about the available metrics, or null if no metrics are available
    Throws:
    java.sql.SQLException
    Since:
    JChem 3.2
    See Also:
    setDissimilarityMetric(String), MolecularDescriptor.getDefaultDissimilarityMetricThresholds(), MolecularDescriptor.getDissimilarityMetrics(), MolecularDescriptor.getDefaultMetricIndex(), MolecularDescriptor.getMetricName(int), setDissimilarityMetric(String)

    setDescriptorName

    public void setDescriptorName(java.lang.String descriptorName)
    Deprecated. since JChem 5.0 use JChemSearchOptions.setDescriptorName(String) instead

    Sets the name of descriptor used for descriptor similarity search

    Parameters:
    descriptorName - the descriptor identifier used for similatiry search. If not specified or null, structural fingerprint similarity search performed by default.
    Since:
    JChem 2.0

    setDescriptorConfig

    public void setDescriptorConfig(java.lang.String descriptorConfig)
    Deprecated. since JChem 5.0 use JChemSearchOptions.setDescriptorConfig(String) instead

    Sets the configuration used for descriptor dissimilarity search

    Parameters:
    descriptorConfig - the configuration used for dissimilarity search calculation. Default value: null (means default configuration)
    Since:
    JChem 2.0.0

    isStructureCaching

    public boolean isStructureCaching()
    Getter for property structureCaching.

    Returns:
    Value of property structureCaching.

    isInfoToStdError

    public boolean isInfoToStdError()
    Getter for property infoToStdError.

    Returns:
    Value of property infoToStdError.

    setInfoToStdError

    public void setInfoToStdError(boolean infoToStdError)
    Setter for property infoToStdError. If set to true, information useful for testing will be written in the servlet server's error log file. (Default: false)

    Parameters:
    infoToStdError - New value of property infoToStdError.

    getConnectionHandler

    public ConnectionHandler getConnectionHandler()
    Getter for property connectionHandler.

    Returns:
    Value of property connectionHandler.

    setConnectionHandler

    public void setConnectionHandler(ConnectionHandler connectionHandler)
    Sets the database connection.

    Parameters:
    connectionHandler - a ConnectionHandler object conaining a live connection to the database

    getConnection

    public java.sql.Connection getConnection()
    Getter for property connection.

    Returns:
    Value of property connection.

    isWaitingForResult

    public boolean isWaitingForResult()
    Deprecated. Replaced by getRunMode().

    Getter for property waitingForResult.

    Returns:
    Value of property waitingForResult.

    setWaitingForResult

    public void setWaitingForResult(boolean waitingForResult)
    Deprecated. replaced by setRunMode(int).

    Setter for property waitingForResult. If the property is true, then processing waits until the end of the search. Otherwise searching takes place in a new thread and run() (or its alternative) returns immediately. (Default: false)

    Parameters:
    waitingForResult - New value of property waitingForResult.

    getRunMode

    public int getRunMode()
    Retruns the current run mode.

    Returns:
    the current run mode.
    Since:
    JChem 5.0
    See Also:
    setRunMode(int)

    setRunMode

    public void setRunMode(int runMode)
    Specifies whether the search is performed synchronously or asychronously and if performed asynchronously, whether the hits can be obtained as soon as they are found or only after the search has completed. Accepted values: The default run mode is RUN_MODE_SYNCH_COMPLETE

    Parameters:
    runMode -
    Since:
    JChem 5.0

    setReturnsNonHits

    public void setReturnsNonHits(boolean value)
    Deprecated. since JChem 5.0 use JChemSearchOptions.setReturnsNonHits(boolean) instead

    Determines if the inverse of the hit set should be returned.

    Parameters:
    value - set to true to get non-hit structures. Default is false.
    Since:
    JChem 2.2

    setSearchOptions

    public void setSearchOptions(JChemSearchOptions options)
    Sets search parameters.

    Parameters:
    options - search options. Will be copied, modification of the original object does not affect future searches unless this method is called again.
    Since:
    JChem 5.0
    See Also:
    getSearchOptions()

    getSearchOptions

    public JChemSearchOptions getSearchOptions()
    Returns the SearchOptions object associated with this Search object. The object returned is linked with this Search object, so modifications in the returned SearchOptions object will change directly the behaviour of this Search object.

    Since:
    JChem 5.0
    See Also:
    setSearchOptions(JChemSearchOptions)

    getAbsoluteStereo

    public int getAbsoluteStereo()
    Deprecated. since JChem 5.0. use JChemSearchOptions.getAbsoluteStereo() instead

    Returns the absolute stereo matching mode.

    Returns:
    the mathcing mode.
    Since:
    JChem 2.2
    See Also:
    setAbsoluteStereo(int)

    setAbsoluteStereo

    public void setAbsoluteStereo(int absoluteStereo)
    Deprecated. since JChem 5.0. use JChemSearchOptions.setAbsoluteStereo(int) instead

    Sets the absolute stereo matching mode.

    Parameters:
    absoluteStereo - the matching mode, one of the following constants: SearchConstants.ABS_STEREO_TABLE_OPTION, SearchConstants.ABS_STEREO_CHIRAL_FLAG, SearchConstants.ABS_STEREO_ALWAYS_ON,
    Since:
    JChem 2.2

    getOrder

    public int getOrder()
    Getter for property order.

    Returns:
    Value of property order.

    setOrder

    public void setOrder(int order)
    Setter for property order. Determines the order of the result.

    Parameters:
    order - New value of property order. Acceptable values: NO_ORDERING, ORDERING_BY_ID, and ORDERING_BY_ID_OR_SIMILARITY (default).

    If an "ORDER BY" clause is used in filter query, and no inverse hit list is requested, this setting is ignored, and the "ORDER BY" clause takes precedence.


    getResultTable

    public java.lang.String getResultTable()
    Getter for property resultTable.

    Returns:
    Value of property resultTable.

    setResultTable

    public void setResultTable(java.lang.String resultTable)
    Setter for property resultTable. Sets the result table that will contain the cd_id of hits. In the case of searching similar structures, the similarity value is also stored in column similarity.

    Parameters:
    resultTable - New value of property resultTable.
    See Also:
    setResultTableMode, getResult

    getResultTableMode

    public int getResultTableMode()
    Getter for property resultTableMode.

    Returns:
    Value of property resultTableMode.

    setResultTableMode

    public void setResultTableMode(int resultTableMode)
    Setter for property resultTableMode. It instructs the searcher about the way of handling the result table. Modes: (Default: NO_RESULT_TABLE)

    Parameters:
    resultTableMode - New value of property resultTableMode.
    See Also:
    setResultTable

    setExactStereoMatching

    public void setExactStereoMatching(boolean exactStereoMatching)
    Deprecated. since JChem 5.0. use SearchOptions.setExactStereoMatching(boolean) instead

    Specifies whether stereo information should match exactly - looking for query stereo properties in target.

    Parameters:
    exactStereoMatching - if set to true, stereo information must match exactly. For example "cis or unspecified" matches only "cis or unspecified", but matches neither "cis", "trans" or "unspecified". The same is true for chirality. Default value is false
    Since:
    JChem 3.0

    isExactStereoMatching

    public boolean isExactStereoMatching()
    Deprecated. since JChem 5.0. use SearchOptions.isExactStereoMatching() instead

    Indicates whether stereo information should match exactly - looking for query stereo properties in target.

    Returns:
    true if stereo information must match exactly. Default value is false
    Since:
    JChem 3.0

    setExactQueryAtomMatching

    public void setExactQueryAtomMatching(boolean exactQueryAtomMatching)
    Deprecated. since JChem 5.0. use SearchOptions.setExactQueryAtomMatching(boolean) instead

    Sets whether exact query atom matching should be used or not.

    Since:
    JChem 3.0
    See Also:
    isExactQueryAtomMatching()

    setStereoSearch

    public void setStereoSearch(boolean stereoSearch)
    Deprecated. since JChem 5.0. use SearchOptions.setStereoSearch(boolean) instead

    Specifies, whether stereo search is performed.

    Parameters:
    stereoSearch - If set to false, no stereo information is considered during searching.(Default: true)
    Since:
    JChem 3.0

    isStereoSearch

    public boolean isStereoSearch()
    Deprecated. since JChem 5.0. use SearchOptions.isStereoSearch() instead

    Indicates, whether stereo search is performed.

    Returns:
    true, is stereo features are considered during the search.
    Since:
    Jchem 3.0

    isExactQueryAtomMatching

    public boolean isExactQueryAtomMatching()
    Deprecated. since JChem 5.0. use SearchOptions.isExactQueryAtomMatching() instead

    Returns whether exact matching of query atom information is set. If true, query information (e.g. atom list, any atom, number of hydrogens, aromaticity, etc.) in atoms will not be evaluated, but rather exact matching of these information is required. It is useful for searching in query databases. Default is false.

    Since:
    JChem 3.0

    setHCountMatching

    public void setHCountMatching(int HCountMatching)
    Deprecated. since JChem 5.0. use SearchOptions.setHCountMatching(int) instead

    Sets the H count matching mode.

    Parameters:
    HCountMatching - possible values:
    Since:
    JChem 3.0
    See Also:
    SearchConstants.HCOUNT_MATCHING_AUTO, SearchConstants.HCOUNT_MATCHING_EQUAL, SearchConstants.HCOUNT_MATCHING_GREATER_OR_EQUAL

    getHCountMatching

    public int getHCountMatching()
    Deprecated. since JChem 5.0. use SearchOptions.getHCountMatching() instead

    Gets the H count matching mode.

    Returns:
    the H count matching mode.
    Since:
    JChem 3.0
    See Also:
    setHCountMatching(int)

    setDoubleBondStereoMatchingMode

    public void setDoubleBondStereoMatchingMode(int mode)
    Deprecated. since JChem 5.0. use SearchOptions.setDoubleBondStereoMatchingMode(int) instead

    Sets how double bond cis/trans stereo information should match during the search.

    Parameters:
    mode - The following options can be used:
    Since:
    JChem 3.0

    getDoubleBondStereoMatchingMode

    public int getDoubleBondStereoMatchingMode()
    Deprecated. since JChem 5.0. use SearchOptions.getDoubleBondStereoMatchingMode() instead

    Getter for property doubleBondStereoMatchingMode.

    Returns:
    the matching mode relating to double bond stereo.
    Since:
    JChem 3.0
    See Also:
    setDoubleBondStereoMatchingMode(int)

    setFilter

    public void setFilter(java.lang.String filterExpression)
    Deprecated. Since 5.0 Use SearchOptions.setChemTermsFilter(String) instead.

    Sets the filtering expression.

    Parameters:
    filterExpression - the filtering expression
    Since:
    JChem 2.3
    See Also:
    MolSearch.setFilter(java.lang.String)

    getFilter

    public java.lang.String getFilter()
    Deprecated. Since 5.0 Use SearchOptions.getChemTermsFilter() instead.

    Gets the filtering expression

    Returns:
    the filtering expression
    Since:
    JChem 2.3
    See Also:
    MolSearch.setFilter(java.lang.String)

    setFilterConfigFileName

    public void setFilterConfigFileName(java.lang.String fileName)
    Deprecated. Since 5.0 Use SearchOptions.setChemTermsFilterConfig(String) instead, using the content of the file as parameter.

    Sets the configutration file for Chemical Terms filter.

    Parameters:
    fileName - the name of the configuration file. Set to null for default configuration.
    Since:
    JChem 3.0
    See Also:
    setFilter(String), MolSearch.setFilterConfig(java.io.File)

    getFilterConfigFileName

    public java.lang.String getFilterConfigFileName()
    Deprecated. Since 5.0 Use SearchOptions.getChemTermsFilterConfig() instead.

    Gets the configutration file for Chemical Terms filter.

    Returns:
    the name of the configuration file.
    Since:
    JChem 3.0
    See Also:
    MolSearch.setFilterConfig(java.io.File)

    setMatchCountInRelation

    public void setMatchCountInRelation(java.lang.String relation,
                                        int hitLimit)
    Deprecated. since JChem 5.0 use JChemSearchOptions.setMatchCountOptions(MatchCountOptions) instead

    Sets the allowed match count for substructure search.

    Parameters:
    relation - The relational operation of the question. This operation will be used to compare the number of hits to hitLimit. Available values:
    "=" - tests equality to hitLimit.
    "<" - returns true if the number of found hits is less than hitLimit.
    "<=" - less than or equality
    ">" - greater than
    ">=" - greater than or equality
    Specifying null disables match count rules.
    hitLimit - The limit for the number of hits.
    Since:
    JChem 3.0
    See Also:
    Search.isMatchCountInRelation(String, int), setMatchCountBetween(int, boolean, int, boolean)

    setMatchCountBetween

    public void setMatchCountBetween(int hitLimitLow,
                                     boolean isLowerLimitIncluded,
                                     int hitLimitHigh,
                                     boolean isHigherLimitIncluded)
    Deprecated. since JChem 5.0 use JChemSearchOptions.setMatchCountOptions(MatchCountOptions) instead

    Sets rules like "the query must match the target between 2 and 5 times (inclusively)" for substructure search. Makes this efficiently, which means it only searches for the number of hits necessary to decide the question.

    Example:

    isMatchCountBetween(2, true, 4, true) - true if the query can be found in the target exactly 2, 3 or 4 times.

    isMatchCountBetween(2, false, 4, false) - true if the query can be found in the target exactly 3 times.

    Parameters:
    hitLimitLow - The lower limit for the number of hits.
    isLowerLimitIncluded - If true, equality is allowed with hitLimitLow.
    hitLimitHigh - The upper limit for the number of hits. If you pass Integer.MAX_VALUE, it will be treated as infinity. (I.e. only the lower limit is applied.)
    isHigherLimitIncluded - If true, equality is allowed with hitLimitHigh.
    Since:
    JChem 3.0
    See Also:
    Search.isMatchCountBetween(int, boolean, int, boolean), setMatchCountInRelation(String, int)

    setTautomerSearch

    public void setTautomerSearch(boolean value)
    Deprecated. since JChem 5.0. use SearchOptions.setTautomerSearch(boolean) instead

    Sets if tautomers of the query should be enumerated for search.

    Parameters:
    value - set to true to enable enumeration of the tautomers of the query for search. The default is false.
    Since:
    JChem 3.2

    getTautomerSearch

    public boolean getTautomerSearch()
    Deprecated. since JChem 5.0. use SearchOptions.isTautomerSearch() instead

    Indicates if tautomers of the query should be enumerated for search.

    Returns:
    wheather tautomers of the query are enumerated for search.
    Since:
    JChem 3.2
    See Also:
    setTautomerSearch(boolean)

    setVagueBondLevel

    public void setVagueBondLevel(int level)
    Deprecated. since JChem 5.0. use SearchOptions.setVagueBondLevel(int) instead

    Option for less strict evaluation of query bonds (e.g. ambiguious aromaticity).

    Parameters:
    level - the desired level. See SearchConstants.OPTION_VAGUE_BOND
    Since:
    JChem 3.2

    getVagueBondLevel

    public int getVagueBondLevel()
    Deprecated. since JChem 5.0. use SearchOptions.getVagueBondLevel() instead

    Getter for vague bond level.

    Returns:
    the current vague bond level
    Since:
    JChem 3.2
    See Also:
    setVagueBondLevel(int)

    setMaxCacheSize

    public void setMaxCacheSize(int maxCacheSizeMB)
    Sets the desired cache memory allocation policy.
    NOTE: the setting takes effect during the very first search in the running JVM, after that the call has no effect. If set to -1 (auto-detect) or minFreeMem is not set to 0, the program tries to determine the maximum amount of memory available for allocation by calling the garbage collector and determinig the available memory.
    NOTE: Under Java Runtime Environment 1.3.1 or older the available memory size cannot be determined. In this case JChem allocates cache for tables until it detects OutOfMemoryError during loading.

    Parameters:
    maxCacheSizeMB - the maximum amount of memory the cache allowed to utitlize in megabytes. Set -1 for auto-detection (default):
    maxCacheSize = available_memory - minFreeMem
    Since:
    JChem 3.0
    See Also:
    setMinNonCachedMemory(int)

    setMinNonCachedMemory

    public void setMinNonCachedMemory(int minNonCachedMemoryMB)
    Sets the desired cache memory allocation policy.
    NOTE: the setting takes effect during the very first search in the running JVM, after that the call has no effect. If not set to 0 or maxCacheSize is set to -1 (auto-detect), the program tries to determine the maximum amount of memory available for allocation by calling the garbage collector and determinig the available memory.
    NOTE: Under Java Runtime Environment 1.3.1 or older the available memory size cannot be determined. In this case JChem allocates cache for tables until it detects OutOfMemoryError during loading.

    Parameters:
    minNonCachedMemoryMB - the minimum amount of memory that should be left free for future non-cache allocations in megabytes.
    Set to 0 if not specified.
    Set to -1 for auto-detection (default):
    • 10 % of all available space for future allocations
    • Not smaller, than 20 MB
    • Nor bigger, than 100 MB
    Since:
    JChem 3.0
    See Also:
    setMaxCacheSize(int)

    setCacheExpirationTime

    public void setCacheExpirationTime(double hours)
    Sets the expiration time for the structure cache. At the start of each search all tables are purged from cache that were searched before the specified time period. Naturally the currently searched table is never purged.

    Parameters:
    hours - the time in hours. The default value is 96. Set to 0 for no expiration.
    Since:
    JChem 3.0
    See Also:
    setMaxCacheSize(int), setMinNonCachedMemory(int)

    setNumberOfProcessingThreads

    public void setNumberOfProcessingThreads(int threads)
    Sets the number of processing threads.

    Parameters:
    threads - the number of threads.
    If set to 0, the number of threads will be equal to the number of logical processors available for the Java Vitual Machine (default).
    NOTE: Under Java Runtime Environment 1.3.1 or older the number of processors cannot be determined. In this case the default number of threads is 16.
    Since:
    JChem 3.0

    setThreadPriority

    public void setThreadPriority(int priority)
    Sets the priority of the processing threads. Only effective, if setRunMode(int) is set to either RUN_MODE_ASYNCH_COMPLETE or RUN_MODE_ASYNCH_PROGRESSIVE.

    Parameters:
    priority - the priority ranging 1 (Thread.MIN_PRIORITY) to 10 (Thread.MAX_PRIORITY).
    The default and recommended setting is 1 (Thread.MIN_PRIORITY).
    NOTE: if all other threads are not constantly calculating, a low priority setting will not slow down the search process, and it will help user interfaces to be responsive.
    Since:
    JChem 3.0

    getResult

    public int getResult(int index)
    Indexed getter for property results. Returns a cd_id value of the found compound specified by index. If result table is generated, getResult throws NullPointerException.

    Parameters:
    index - Index of the property.
    Returns:
    Value of the property at index.
    See Also:
    setResultTable

    getResults

    public int[] getResults()
    Returns an int array containing the cd_id values of found compounds. If a result table is generated in the database, it returns null.


    cleanResults

    public void cleanResults()
    Cleans stored search results. Can be called to save memory while keeping the JChemSearch object. since JChem 3.0


    getDissimilarity

    public float getDissimilarity(int index)
    Indexed getter for property dissimilarity. Returns the calculated dissimilarity value of the found compound specified by index and the query structure. If searching has not been finished yet or if a result table is generated, getDissimilarity throws NullPointerException.

    Parameters:
    index - Index of the property.
    Returns:
    Value of the property at index.
    See Also:
    setResultTable

    getDissimilarity

    public float[] getDissimilarity()
    Getter for dissimilarity results. Returns the calculated dissimilarity values calculated for the last query strucutre. If searching has not been finished yet or if a result table is generated, getDissimilarity throws NullPointerException.

    Returns:
    the dissimilarity results.
    See Also:
    setResultTable

    getProgressMessage

    public java.lang.String getProgressMessage()
    Getter for property progressMessage. It returns a message that shows the state of the search. It can be used for showing the progress of the search.

    Returns:
    Value of property progressMessage.

    getCurrentId

    public int getCurrentId()
    Getter for property currentId. It returns the current cd_id of molecule being searched. It can be used for showing the progress of the search.

    Returns:
    Value of property currentId.

    isMaxResultCountReached

    public boolean isMaxResultCountReached()
    Getter for property maxResultCountReached. It returns true if the search was stopped because the number of hits had reached the maximum value, false otherwise.

    Returns:
    Value of property maxResultCountReached.

    isMaxTimeReached

    public boolean isMaxTimeReached()
    Getter for property maxTimeReached. It returns true if the search stopped because the time that passed since the start of the searched had reached the maximum value, false otherwise.

    Returns:
    Value of property maxTimeReached.

    getResultCount

    public int getResultCount()
    Getter for property resultCount. It returns the number of hits found by the search.

    Returns:
    Value of property resultCount.

    setTimeout

    public void setTimeout(int seconds)
    Sets the timeout value in seconds. If the search is run in a thread, isRunning() must be constantly called within the specified time interval, otherwise the search stops. Useful if the user no longer monitors the search process, e.g. closes the browser window.

    Parameters:
    seconds - the timeout in seconds. Set to 0 to disable (default).
    Since:
    JChem 3.0
    See Also:
    setRunMode(int)

    getTimeout

    public int getTimeout()
    Gets the current timout setting.

    Returns:
    the current timeout setting.
    Since:
    JChem 3.0
    See Also:
    setTimeout(int)

    isRunning

    public boolean isRunning()
    Getter for property running.

    Returns:
    Value of property running.

    setRunning

    public void setRunning(boolean run)
                    throws java.sql.SQLException,
                           MolFormatException,
                           java.io.IOException,
                           DatabaseSearchException,
                           PropertyNotSetException
    Setter for property running. If it is set to true and the search has not been started yet, then searching is unleashed. If it is set to false and a search is running, the the process will be stopped. (Default: false)

    Parameters:
    run - New value of property run.
    Throws:
    java.sql.SQLException
    MolFormatException
    java.io.IOException
    DatabaseSearchException
    PropertyNotSetException

    run

    public void run()
             throws java.sql.SQLException,
                    MolFormatException,
                    java.io.IOException,
                    DatabaseSearchException,
                    PropertyNotSetException
    Starts searching. Same as setRunning(true)

    Throws:
    java.sql.SQLException
    MolFormatException
    java.io.IOException
    DatabaseSearchException
    PropertyNotSetException

    run_NE

    public void run_NE()
    Deprecated. since JChem 5.2 use run()

    Starts searching. Same as setRunning(true), but Exceptions are caught and stored.


    clearCache

    public static void clearCache()
    Clears the cache that stores fingerprints and structures.


    getScreenedCount

    public int getScreenedCount()
    Gets the number of screeened structures.

    Returns:
    the number of screened structures

    getScreeningTime

    public long getScreeningTime()
    Gets the screening time.

    Returns:
    the screening time in milliseconds

    getSearchTime

    public long getSearchTime()
    Gets the total search time.

    Returns:
    the search time in milliseconds (includes screening time)

    getHitsAsMolecules

    public Molecule[] getHitsAsMolecules(int[] idList,
                                         HitColoringAndAlignmentOptions options,
                                         java.util.ArrayList dataFieldNames,
                                         java.util.ArrayList dataFieldValues)
                                  throws java.sql.SQLException,
                                         java.io.IOException,
                                         chemaxon.sss.search.SearchException,
                                         chemaxon.enumeration.supergraph.SupergraphException,
                                         PropertyNotSetException,
                                         DatabaseSearchException
    Returns hits ready for display. If hit alignment or coloring is needed, the graph search must be repeated for the selected structures to obtain the atom indexes fo hits. (Storing this data would consume too much memory for large hit sets) If alignment mode has been set to rotate, and query has 0 dimension, it will be cleaned in 2d. If alignment mode has been set to partial clean, this option will be changed to rotate in this case.

    Parameters:
    idList - the cd_id list of hits to be retrieved.
    options - the options for coloring and alignment. If null the structures will be displayed in their original form.
    dataFieldNames - fields of the jchem table that should be fetched together with the structure or null.
    dataFieldValues - an empty ArrayList required or can be null. The fetched values will be stored in this object as Object[] elements.
    Returns:
    the hits as Molecules, colored and aligned if needed. If coloring is specified in case of SearchConstants.SUPERSTRUCTURE search mode, always the query structure is returned, the target subgraph is colored.
    Throws:
    java.sql.SQLException
    java.io.IOException
    chemaxon.sss.search.SearchException
    chemaxon.enumeration.supergraph.SupergraphException
    PropertyNotSetException
    DatabaseSearchException
    Since:
    JChem 5.0

    setRegCode

    public void setRegCode(long code)
    Sets the registration code. FOR INTERNAL USE.
    Should be called before the very first search.

    Parameters:
    code - the code. If not 0, overrides the value found in the property table.
    Since:
    JChem 3.1

    isLicensed

    public boolean isLicensed()
    Description copied from interface: chemaxon.license.Licensable
    Returns information about the licensing of the product. Example implementation: return LicenseHandler.isLicensed( LicenseHandler.MY_IDENTIFIER, licenseEnvironment );

    Specified by:
    isLicensed in interface chemaxon.license.Licensable
    Returns:
    true if the product is correctly licensed

    setLicenseEnvironment

    public void setLicenseEnvironment(java.lang.String env)
    Description copied from interface: chemaxon.license.Licensable
    Every license can have a modifier environment that's typically an integration environment. All being Licensable should be prepared to store and show a set environment to the LicenseHandler. Example implementation:
     private String licenseEnvironment = "";
     public void setLicenseEnvironment(String env) {
         licenseEnvironment = env;
     }
     

    Specified by:
    setLicenseEnvironment in interface chemaxon.license.Licensable
    Parameters:
    env - environment String to be stored and passed to the LicenseHandler in the isLicensed method

    hasMoreHits

    public boolean hasMoreHits()
                        throws java.lang.InterruptedException
    Used with run mode = RUN_MODE_ASYNCH_PROGRESSIVE.
    Returns true if there are more hits to retrieve with getNextHit() or getAvailableNewHits(int), false otherwise.

    Returns:
    true if there are more hits to retrieve with getNextHit() or getAvailableNewHits(int), false otherwise.
    Throws:
    java.lang.InterruptedException
    Since:
    JChem 5.0

    getNextHit

    public int getNextHit()
                   throws java.lang.InterruptedException
    Used with run mode = RUN_MODE_ASYNCH_PROGRESSIVE.
    Returns the next available hit. Waits until at least one is available or throws NoSuchElementException, there are no more hits to return.

    Returns:
    the next available hit. Waits until at least one is available or throws NoSuchElementException, there are no more hits to return.
    Throws:
    java.lang.InterruptedException - if the calling thread was interrupted while waiting for the next available hit.
    Since:
    JChem 5.0

    getAvailableNewHits

    public int[] getAvailableNewHits(int arraySize)
                              throws java.lang.InterruptedException,
                                     DatabaseSearchException
    Used with run mode = RUN_MODE_ASYNCH_PROGRESSIVE.
    Returns all new hits available at the time of return, but at least arraySize new hits.

    Parameters:
    arraySize -
    Returns:
    all new hits available at the time of return, but at least arraySize new hits.
    Throws:
    java.lang.InterruptedException - if the calling thread was interrupted while waiting.
    DatabaseSearchException
    Since:
    JChem 5.0

    waitUntilSearchComplete

    public void waitUntilSearchComplete()
                                 throws java.lang.InterruptedException
    Used with run mode = RUN_MODE_ASYNCH_PROGRESSIVE.
    Waits until after the search has completed.

    Throws:
    java.lang.InterruptedException - if the calling thread was interrupted while waiting.
    Since:
    JChem 5.0