Package chemaxon.jep.context
Class ReactionContext
java.lang.Object
chemaxon.jep.context.ReactionContext
- All Implemented Interfaces:
ChemContext
,chemaxon.marvin.util.CallbackIface
,Serializable
@PublicApi
@ProvidesFunction(minParameterCount=1,
maxParameterCount=1,
names={"reactant","product","agent","ratom","patom","aatom"})
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.
- Since:
- JChem 2.2, Marvin 5.1
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface chemaxon.jep.ChemContext
ChemContext.ProvidesFunction, ChemContext.ProvidesFunctionContainer
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String[]
The context function names.static final String
static final String
static final String
static final String
Fields inherited from interface chemaxon.jep.ChemContext
VARARG
-
Constructor Summary
ConstructorDescriptionConstructor.ReactionContext
(boolean copy) Deprecated, for removal: This API element is subject to removal in a future version.Copy feature is no longer required.ReactionContext
(RxnMolecule reaction) Constructs a reaction context with specified reaction. -
Method Summary
Modifier and TypeMethodDescriptioncallContextFunction
(String name, List<Object> params) Executes the specified context function with the given parameters.void
clear()
Clears the context.String[]
Deprecated, for removal: This API element is subject to removal in a future version.Use theChemContext.ProvidesFunction
annotation instead.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface chemaxon.jep.ChemContext
callback, getVariable
-
Field Details
-
REACTANT
- See Also:
-
PRODUCT
- See Also:
-
AGENT
- See Also:
-
RATOM
- See Also:
-
PATOM
- See Also:
-
AATOM
- See Also:
-
CFNS
The context function names.
-
-
Constructor Details
-
ReactionContext
public ReactionContext()Constructor. -
ReactionContext
Constructs a reaction context with specified reaction.- Parameters:
reaction
- the reaction to wrap- Since:
- 6.2
-
ReactionContext
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public ReactionContext(boolean copy) Deprecated, for removal: This API element is subject to removal in a future version.Copy feature is no longer required. Constructor.- Parameters:
copy
- is true if map arrays should be copied
-
-
Method Details
-
getContextFunctionNames
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public String[] getContextFunctionNames()Deprecated, for removal: This API element is subject to removal in a future version.Use theChemContext.ProvidesFunction
annotation instead.Returns {"reactant", "product", "ratom", "patom"}.- Specified by:
getContextFunctionNames
in interfaceChemContext
- Returns:
- {"reactant", "product", "ratom", "patom"}
-
callContextFunction
Executes the specified context function with the given parameters.Implemented functions:
name parameter 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:
callContextFunction
in interfaceChemContext
- Parameters:
name
- the context function name (as specified byChemContext.ProvidesFunction.names()
)params
- the context function parameters. The size of this list must be between theminimum
andmaximum
allowed.- Returns:
- the context element, or null if the given function is not supported
- Throws:
JepException
- on error
-
setReaction
Sets the reaction.- Parameters:
reaction
- the reaction to set- Since:
- 6.2
-
getReaction
Returns the reaction.- Returns:
- the reaction
- Since:
- 6.2
-
setReactants
Deprecated.UsesetReaction(RxnMolecule)
instead. Sets the reactants.- Parameters:
reactants
- is the reactant array
-
setProducts
Deprecated.UsesetReaction(RxnMolecule)
instead. Sets the products.- Parameters:
products
- is the product array
-
setReactantAtomsByMap
Deprecated.usesetReaction(RxnMolecule)
instead. Sets the map -> reactant atom array.- Parameters:
ma
- is the map -> reactant atom array
-
setProductAtomsByMap
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
-