Package chemaxon.chemterms
Class ReactionContext
java.lang.Object
chemaxon.chemterms.ReactionContext
- All Implemented Interfaces:
ChemTermsContext
@PublicApi
@ProvidesFunction(minParameterCount=1,
maxParameterCount=1,
names={"reactant","product","agent","ratom","patom","aatom"})
public class ReactionContext
extends Object
implements ChemTermsContext
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface chemaxon.chemterms.ChemTermsContext
ChemTermsContext.ProvidesFunction, ChemTermsContext.ProvidesFunctionContainer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final String[]The context function names.static final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface chemaxon.chemterms.ChemTermsContext
VARARG -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.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.voidclear()Clears the context.Returns the reaction.booleanisEmpty()Returnstrueif the context is empty.voidsetProductAtomsByMap(MolAtom[] ma) Deprecated.voidsetProducts(Molecule[] products) Deprecated.UsesetReaction(RxnMolecule)instead.voidsetReactantAtomsByMap(MolAtom[] ma) Deprecated.usesetReaction(RxnMolecule)instead.voidsetReactants(Molecule[] reactants) Deprecated.UsesetReaction(RxnMolecule)instead.final voidsetReaction(RxnMolecule reaction) Sets the reaction.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface chemaxon.chemterms.ChemTermsContext
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
-
-
Method Details
-
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:
callContextFunctionin interfaceChemTermsContext- Parameters:
name- the context function name (as specified byChemTermsContext.ProvidesFunction.names())params- the context function parameters. The size of this list must be between theminimumandmaximumallowed.- Returns:
- the context element, or null if the given function is not supported
- Throws:
ChemTermsException- 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()Returnstrueif the context is empty.- Returns:
trueif the context is empty
-
clear
public void clear()Clears the context.- Specified by:
clearin interfaceChemTermsContext
-
setReaction(RxnMolecule)instead.