chemaxon.jep.context
Class SearchContext

java.lang.Object
  extended by chemaxon.jep.ChemContext
      extended by chemaxon.jep.context.MolContext
          extended by chemaxon.jep.context.SearchContext
All Implemented Interfaces:
chemaxon.marvin.util.CallbackIface, java.io.Serializable

public class SearchContext
extends MolContext

Expression evaluation context containing search hit data: the target, the query and the hit. Provides function names for accessing context elements through the CallbackIface.

Since:
JChem 2.3, Marvin 5.1
Author:
Nora Mate
See Also:
Serialized Form

Field Summary
static java.lang.String[] CFNS
          The context function names.
protected static int MAXMAPS
          Maximal number of map values.
 
Constructor Summary
SearchContext()
          Constructor.
 
Method Summary
 java.lang.Object callback(java.lang.String method, java.lang.Object arg)
          Implements CallbackIface.
 void clear()
          Clears the context.
 java.lang.String[] getContextFunctionNames()
          Returns {"mol", "target", "query", "fingerprint", "tfingerprint", "qfingerprint", "m", "hit", "h", "hm", "hitmap"}.
 Molecule getQuery()
          Returns the query molecule.
 int[] getQueryFingerprint()
          Returns the query molecule fingerprint.
protected  int[] getQueryFingerprint(java.lang.Object arg)
          Returns the query molecule fingerprint if argument is the query molecule, null otherwise.
 Molecule getTarget()
          Returns the target molecule.
 int[] getTargetFingerprint()
          Returns the target molecule fingerprint.
 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.
 void setQuery(Molecule query)
          Sets the query molecule and the map array.
 void setQueryFingerprint(int[] fingerprint)
          Sets the fingerprint of the query molecule.
 void setTarget(Molecule target)
          Sets the target molecule.
 void setTargetFingerprint(int[] fingerprint)
          Sets the fingerprint of the target molecule.
 
Methods inherited from class chemaxon.jep.context.MolContext
getFingerprint, getFingerprint, getMolecule, setFingerprint, setMolecule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CFNS

public static java.lang.String[] CFNS
The context function names.


MAXMAPS

protected static final int MAXMAPS
Maximal number of map values.

See Also:
Constant Field Values
Constructor Detail

SearchContext

public SearchContext()
Constructor.

Method Detail

getContextFunctionNames

public java.lang.String[] getContextFunctionNames()
Returns {"mol", "target", "query", "fingerprint", "tfingerprint", "qfingerprint", "m", "hit", "h", "hm", "hitmap"}. This is the accessor function name for getting the context elements.

Overrides:
getContextFunctionNames in class MolContext
Returns:
{"mol", "target", "query", "fingerprint", "tfingerprint", "qfingerprint", "m", "hit", "h", "hm", "hitmap"}

callback

public java.lang.Object callback(java.lang.String method,
                                 java.lang.Object arg)
Implements CallbackIface. Returns null for unimplemented callbacks. Implemented callbacks:
methodargreturn value
"mol"nullthe target molecule
"target"nullthe target molecule
"query"nullthe query molecule
"fingerprint"nullthe target molecule fingerprint
"tfingerprint"nullthe target molecule fingerprint
"qfingerprint"nullthe query molecule fingerprint
"m"intthe index of query atom with given map
"hit"
"h"
nullthe 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:
callback in interface chemaxon.marvin.util.CallbackIface
Overrides:
callback in class MolContext
Parameters:
method - is the accessor method name
arg - is the accessor method argument (the JEP parameter stack as null, a single parameter object or a parameter object array depending on the number of parameters on the stack)
Returns:
the context element, or ParseException on error

setTarget

public void setTarget(Molecule target)
Sets the target molecule.

Parameters:
target - is the target molecule

getTarget

public Molecule getTarget()
Returns the target molecule.

Returns:
the target molecule

setQuery

public void setQuery(Molecule query)
Sets the query molecule and the map array.

Parameters:
query - is the query molecule

getQuery

public 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

protected int[] getQueryFingerprint(java.lang.Object arg)
Returns the query molecule fingerprint if argument is the query molecule, null otherwise.

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.

Overrides:
clear in class MolContext