Package chemaxon.jep.context
Class ReactionContext
- java.lang.Object
-
- chemaxon.jep.context.ReactionContext
-
- All Implemented Interfaces:
ChemContext
,chemaxon.marvin.util.CallbackIface
,Serializable
@PublicAPI public class ReactionContext extends Object implements 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 theCallbackIface
.- Since:
- JChem 2.2, Marvin 5.1
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ReactionContext()
Constructor.ReactionContext(boolean copy)
Deprecated.Copy feature is no longer required.ReactionContext(RxnMolecule reaction)
Constructs a reaction context with specified reaction.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Object
callback(String method, Object arg)
ImplementsCallbackIface
.void
clear()
Clears the context.String[]
getContextFunctionNames()
Returns {"reactant", "product", "ratom", "patom"}.RxnMolecule
getReaction()
Returns the reaction.boolean
isEmpty()
Returnstrue
if the context is empty.void
setProductAtomsByMap(MolAtom[] ma)
Deprecated.usesetReaction(RxnMolecule)
instead.void
setProducts(Molecule[] products)
Deprecated.UsesetReaction(RxnMolecule)
instead.void
setReactantAtomsByMap(MolAtom[] ma)
Deprecated.usesetReaction(RxnMolecule)
instead.void
setReactants(Molecule[] reactants)
Deprecated.UsesetReaction(RxnMolecule)
instead.void
setReaction(RxnMolecule reaction)
Sets the reaction.
-
-
-
Field Detail
-
REACTANT
public static final String REACTANT
- See Also:
- Constant Field Values
-
PRODUCT
public static final String PRODUCT
- See Also:
- Constant Field Values
-
AGENT
public static final String AGENT
- See Also:
- Constant Field Values
-
RATOM
public static final String RATOM
- See Also:
- Constant Field Values
-
PATOM
public static final String PATOM
- See Also:
- Constant Field Values
-
AATOM
public static final String AATOM
- See Also:
- Constant Field Values
-
CFNS
public static String[] CFNS
The context function names.
-
-
Constructor Detail
-
ReactionContext
public ReactionContext()
Constructor.
-
ReactionContext
public ReactionContext(RxnMolecule reaction)
Constructs a reaction context with specified reaction.- Parameters:
reaction
- the reaction to wrap- Since:
- 6.2
-
ReactionContext
@Deprecated public ReactionContext(boolean copy)
Deprecated.Copy feature is no longer required. Constructor.- Parameters:
copy
- is true if map arrays should be copied
-
-
Method Detail
-
getContextFunctionNames
public String[] getContextFunctionNames()
Returns {"reactant", "product", "ratom", "patom"}.- Specified by:
getContextFunctionNames
in interfaceChemContext
- Returns:
- {"reactant", "product", "ratom", "patom"}
-
callback
public Object callback(String method, Object arg)
ImplementsCallbackIface
. Returnsnull
for unimplemented callbacks. Implemented callbacks:method arg return value "reactant" reactant index (Integer, 0-based) the reactant "product" product index (Integer, 0-based) the product "ratom" atom map (Integer) the reactant atom "patom" atom map (Integer) the product atom - Specified by:
callback
in interfacechemaxon.marvin.util.CallbackIface
- Specified by:
callback
in interfaceChemContext
- Parameters:
method
- is the accessor method namearg
- is the accessor method argument (the JEP parameter stack asnull
, a single parameter object or a parameter object array depending on the number of parameters on the stack)- Returns:
- the context element
-
setReaction
public void setReaction(RxnMolecule reaction)
Sets the reaction.- Parameters:
reaction
- the reaction to set- Since:
- 6.2
-
getReaction
public RxnMolecule getReaction()
Returns the reaction.- Returns:
- the reaction
- Since:
- 6.2
-
setReactants
@Deprecated public void setReactants(Molecule[] reactants)
Deprecated.UsesetReaction(RxnMolecule)
instead. Sets the reactants.- Parameters:
reactants
- is the reactant array
-
setProducts
@Deprecated public void setProducts(Molecule[] products)
Deprecated.UsesetReaction(RxnMolecule)
instead. Sets the products.- Parameters:
products
- is the product array
-
setReactantAtomsByMap
@Deprecated public void setReactantAtomsByMap(MolAtom[] ma)
Deprecated.usesetReaction(RxnMolecule)
instead. Sets the map -> reactant atom array.- Parameters:
ma
- is the map -> reactant atom array
-
setProductAtomsByMap
@Deprecated public void setProductAtomsByMap(MolAtom[] ma)
Deprecated.usesetReaction(RxnMolecule)
instead. Sets the map -> product atom array.- Parameters:
ma
- is the map -> product atom array
-
isEmpty
public boolean isEmpty()
Returnstrue
if the context is empty.- Returns:
true
if the context is empty
-
clear
public void clear()
Clears the context.- Specified by:
clear
in interfaceChemContext
-
-