public class ReactionContext extends Object implements ChemContext
CallbackIface
.Modifier and Type | Field and Description |
---|---|
static String[] |
CFNS
The context function names.
|
static String |
PATOM |
static String |
PRODUCT |
static String |
RATOM |
static 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 |
---|---|
Object |
callback(String method,
Object arg)
Implements
CallbackIface . |
void |
clear()
Clears the context.
|
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 String REACTANT
public static final String PRODUCT
public static final String RATOM
public static final String PATOM
public static 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 String[] getContextFunctionNames()
getContextFunctionNames
in interface ChemContext
public Object callback(String method, 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