Package chemaxon.chemterms
Class SearchContext
java.lang.Object
chemaxon.chemterms.MolContext
chemaxon.chemterms.SearchContext
- All Implemented Interfaces:
ChemTermsContext
@PublicApi
@ProvidesFunction(minParameterCount=0,maxParameterCount=0,names={"mol","target","query"}) @ProvidesFunction(minParameterCount=0,maxParameterCount=1,names={"hit","h"}) @ProvidesFunction(minParameterCount=1,maxParameterCount=1,names={"fingerprint","tfingerprint","qfingerprint","m","hitmap","hm"})
public class SearchContext
extends MolContext
Expression evaluation context containing search hit data:
the target, the query and the hit.
- Since:
- JChem 2.3, Marvin 5.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface chemaxon.chemterms.ChemTermsContext
ChemTermsContext.ProvidesFunction, ChemTermsContext.ProvidesFunctionContainer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final intMaximal number of map values.static final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class chemaxon.chemterms.MolContext
FINGERPRINT, MOLFields inherited from interface chemaxon.chemterms.ChemTermsContext
VARARG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncallContextFunction(String name, List<Object> params) Executes the specified context function with the given parameters.voidclear()Clears the context.getQuery()Returns the query molecule.int[]Returns the query molecule fingerprint.protected int[]Returns the query molecule fingerprint if argument is the query molecule,nullotherwise.Returns the target molecule.int[]Returns the target molecule fingerprint.voidsetHit(int[] hit) Sets the search hit, as a query atom index -> target atom index array, with negative target atom index denoting match on implicit H.voidSets the query molecule and the map array.voidsetQueryFingerprint(int[] fingerprint) Sets the fingerprint of the query molecule.voidSets the target molecule.voidsetTargetFingerprint(int[] fingerprint) Sets the fingerprint of the target molecule.Methods inherited from class chemaxon.chemterms.MolContext
getFingerprint, getFingerprint, getMolecule, setFingerprint, setMolecule, setSupplierMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface chemaxon.chemterms.ChemTermsContext
getVariable
-
Field Details
-
TARGET
- See Also:
-
QUERY
- See Also:
-
M
- See Also:
-
HIT
- See Also:
-
H
- See Also:
-
HM
- See Also:
-
HITMAP
- See Also:
-
TFINGERPRINT
- See Also:
-
QFINGERPRINT
- See Also:
-
MAXMAPS
protected static final int MAXMAPSMaximal number of map values.- See Also:
-
-
Constructor Details
-
SearchContext
public SearchContext()Constructor.
-
-
Method Details
-
callContextFunction
Executes the specified context function with the given parameters.Implemented functions:
name parameter return value "mol" the target molecule "target" the target molecule "query" the query molecule "fingerprint" Moleculethe target molecule fingerprint "tfingerprint" Moleculethe target molecule fingerprint "qfingerprint" Moleculethe query molecule fingerprint "m" intthe index of query atom with given map "hit"
"h"the search hit (target atom indices) "hit"
"h"intthe target atom index corresponding to the specified query atom "hm"
"hitmap"intthe target atom index corresponding to the query atom with the specified map - Specified by:
callContextFunctionin interfaceChemTermsContext- Overrides:
callContextFunctionin classMolContext- Parameters:
name- the context function name (as specified byChemTermsContext.ProvidesFunction.names())params- the context function parameters. The size of this list must be between theminimumandmaximumallowed.- Returns:
- the context element, or null if the given function is not supported
- Throws:
ChemTermsException- on error
-
setTarget
Sets the target molecule.- Parameters:
target- is the target molecule
-
getTarget
Returns the target molecule.- Returns:
- the target molecule
-
setQuery
Sets the query molecule and the map array.- Parameters:
query- is the query molecule
-
getQuery
Returns the query molecule.- Returns:
- the query molecule
-
setTargetFingerprint
public void setTargetFingerprint(int[] fingerprint) Sets the fingerprint of the target molecule.- Parameters:
fingerprint- is the fingerprint
-
getTargetFingerprint
public int[] getTargetFingerprint()Returns the target molecule fingerprint.- Returns:
- the target molecule fingerprint
-
setQueryFingerprint
public void setQueryFingerprint(int[] fingerprint) Sets the fingerprint of the query molecule.- Parameters:
fingerprint- is the fingerprint
-
getQueryFingerprint
public int[] getQueryFingerprint()Returns the query molecule fingerprint.- Returns:
- the query molecule fingerprint
-
getQueryFingerprint
Returns the query molecule fingerprint if argument is the query molecule,nullotherwise.- Parameters:
arg- is the argument to be checked against the query molecule- Returns:
- the query molecule fingerprint or
null
-
setHit
public void setHit(int[] hit) Sets the search hit, as a query atom index -> target atom index array, with negative target atom index denoting match on implicit H.- Parameters:
hit- is the search hit
-
clear
public void clear()Clears the context.- Specified by:
clearin interfaceChemTermsContext- Overrides:
clearin classMolContext
-