@PublicAPI public class ReactionContext extends java.lang.Object implements ChemContext
CallbackIface
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AATOM |
static java.lang.String |
AGENT |
static java.lang.String[] |
CFNS
The context function names.
|
static java.lang.String |
PATOM |
static java.lang.String |
PRODUCT |
static java.lang.String |
RATOM |
static java.lang.String |
REACTANT |
Constructor and Description |
---|
ReactionContext()
Constructor.
|
ReactionContext(boolean copy)
Deprecated.
Copy feature is no longer required.
Constructor.
|
ReactionContext(RxnMolecule reaction)
Constructs a reaction context with specified reaction.
|
Modifier and Type | Method and Description |
---|---|
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"}.
|
RxnMolecule |
getReaction()
Returns the reaction.
|
boolean |
isEmpty()
Returns
true if the context is empty. |
void |
setProductAtomsByMap(MolAtom[] ma)
Deprecated.
use
setReaction(RxnMolecule) instead.
Sets the map -> product atom array. |
void |
setProducts(Molecule[] products)
Deprecated.
Use
setReaction(RxnMolecule) instead.
Sets the products. |
void |
setReactantAtomsByMap(MolAtom[] ma)
Deprecated.
use
setReaction(RxnMolecule) instead.
Sets the map -> reactant atom array. |
void |
setReactants(Molecule[] reactants)
Deprecated.
Use
setReaction(RxnMolecule) instead.
Sets the reactants. |
void |
setReaction(RxnMolecule reaction)
Sets the reaction.
|
public static final java.lang.String REACTANT
public static final java.lang.String PRODUCT
public static final java.lang.String AGENT
public static final java.lang.String RATOM
public static final java.lang.String PATOM
public static final java.lang.String AATOM
public static java.lang.String[] CFNS
public ReactionContext()
public ReactionContext(RxnMolecule reaction)
reaction
- the reaction to wrap@Deprecated public ReactionContext(boolean copy)
copy
- is true if map arrays should be copiedpublic java.lang.String[] getContextFunctionNames()
getContextFunctionNames
in interface ChemContext
public java.lang.Object callback(java.lang.String method, java.lang.Object arg)
CallbackIface
.
Returns null
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 |
callback
in interface ChemContext
callback
in interface chemaxon.marvin.util.CallbackIface
method
- is the accessor method namearg
- 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)public void setReaction(RxnMolecule reaction)
reaction
- the reaction to setpublic RxnMolecule getReaction()
@Deprecated public void setReactants(Molecule[] reactants)
setReaction(RxnMolecule)
instead.
Sets the reactants.reactants
- is the reactant array@Deprecated public void setProducts(Molecule[] products)
setReaction(RxnMolecule)
instead.
Sets the products.products
- is the product array@Deprecated public void setReactantAtomsByMap(MolAtom[] ma)
setReaction(RxnMolecule)
instead.
Sets the map -> reactant atom array.ma
- is the map -> reactant atom array@Deprecated public void setProductAtomsByMap(MolAtom[] ma)
setReaction(RxnMolecule)
instead.
Sets the map -> product atom array.ma
- is the map -> product atom arraypublic boolean isEmpty()
true
if the context is empty.true
if the context is emptypublic void clear()
clear
in interface ChemContext