chemaxon.jep.context
Class MolContext

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

public class MolContext
extends ChemContext

Expression evaluation context containing a single molecule. Provides function names for accessing context elements through the CallbackIface.

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

Field Summary
static java.lang.String[] CFNS
          The context function names.
 
Constructor Summary
MolContext()
          Constructor.
MolContext(Molecule m)
          Creates a MolContext with the given input molecule.
 
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", "fingerprint"}.
 int[] getFingerprint()
          Returns the input molecule fingerprint.
protected  int[] getFingerprint(java.lang.Object arg)
          Returns the input molecule fingerprint if argument is the input molecule, null otherwise.
 Molecule getMolecule()
          Returns the input molecule.
 void setFingerprint(int[] fingerprint)
          Sets the fingerprint of the input molecule.
 void setMolecule(Molecule mol)
          Sets the input molecule.
 
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.

Constructor Detail

MolContext

public MolContext()
Constructor.


MolContext

public MolContext(Molecule m)
Creates a MolContext with the given input molecule.

Since:
Marvin 5.2
Method Detail

getContextFunctionNames

public java.lang.String[] getContextFunctionNames()
Returns {"mol", "fingerprint"}. This is the accessor function name for getting the molecule.

Overrides:
getContextFunctionNames in class ChemContext
Returns:
{"mol", "fingerprint"}

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 input molecule
"fingerprint"nullthe input molecule fingerprint

Specified by:
callback in interface chemaxon.marvin.util.CallbackIface
Overrides:
callback in class ChemContext
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

setMolecule

public void setMolecule(Molecule mol)
Sets the input molecule.

Parameters:
mol - is the input molecule

getMolecule

public Molecule getMolecule()
Returns the input molecule.

Returns:
the input molecule

setFingerprint

public void setFingerprint(int[] fingerprint)
Sets the fingerprint of the input molecule.

Parameters:
fingerprint - is the fingerprint

getFingerprint

public int[] getFingerprint()
Returns the input molecule fingerprint.

Returns:
the input molecule fingerprint

getFingerprint

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

Parameters:
arg - is the argument to be checked against the input molecule
Returns:
the input molecule fingerprint or null

clear

public void clear()
Clears the context.

Overrides:
clear in class ChemContext