chemaxon.jep.context
Class ReactionContext

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

public class ReactionContext
extends ChemContext

Expression evaluation context to evaluate reaction conditions. Contains reaction context elements: reactants, products, map-to-atom correspondences for both sides. 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
ReactionContext()
          Constructor.
ReactionContext(boolean copy)
          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 {"reactant", "product", "ratom", "patom"}.
 boolean isEmpty()
          Returns true if the context is empty.
 void setProductAtomsByMap(MolAtom[] ma)
          Sets the map -> product atom array.
 void setProducts(Molecule[] products)
          Sets the products.
 void setReactantAtomsByMap(MolAtom[] ma)
          Sets the map -> reactant atom array.
 void setReactants(Molecule[] reactants)
          Sets the reactants.
 
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

ReactionContext

public ReactionContext()
Constructor.


ReactionContext

public ReactionContext(boolean copy)
Constructor.

Parameters:
copy - is true if map arrays should be copied
Method Detail

getContextFunctionNames

public java.lang.String[] getContextFunctionNames()
Returns {"reactant", "product", "ratom", "patom"}.

Overrides:
getContextFunctionNames in class ChemContext
Returns:
{"reactant", "product", "ratom", "patom"}

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
"reactant"reactant index (Integer, 0-based)the reactant
"product"product index (Integer, 0-based)the ptoduct
"ratom"atom map (Integer)the reactant atom
"patom"atom map (Integer)the product atom

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

setReactants

public void setReactants(Molecule[] reactants)
Sets the reactants.

Parameters:
reactants - is the reactant array

setProducts

public void setProducts(Molecule[] products)
Sets the products.

Parameters:
products - is the product array

setReactantAtomsByMap

public void setReactantAtomsByMap(MolAtom[] ma)
Sets the map -> reactant atom array.

Parameters:
ma - is the map -> reactant atom array

setProductAtomsByMap

public void setProductAtomsByMap(MolAtom[] ma)
Sets the map -> product atom array.

Parameters:
ma - is the map -> product atom array

isEmpty

public boolean isEmpty()
Returns true if the context is empty.

Returns:
true if the context is empty

clear

public void clear()
Clears the context.

Overrides:
clear in class ChemContext