Package chemaxon.jep.context
Class MolContext
java.lang.Object
chemaxon.jep.context.MolContext
- All Implemented Interfaces:
ChemContext
,chemaxon.marvin.util.CallbackIface
,Serializable
- Direct Known Subclasses:
AtomContext
@PublicApi
@ProvidesFunction(minParameterCount=0,maxParameterCount=0,names="mol") @ProvidesFunction(minParameterCount=1,maxParameterCount=1,names={"fingerprint","reactant","product","agent","ratom","patom","aatom"})
public class MolContext
extends Object
implements ChemContext
Expression evaluation context containing a single molecule.
- 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
Fields inherited from interface chemaxon.jep.ChemContext
VARARG
-
Constructor Summary
ConstructorDescriptionConstructor.Creates a MolContext with the given input molecule. -
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.int[]
Returns the input molecule fingerprint.protected int[]
getFingerprint
(Object arg) Returns the input molecule fingerprint if argument is the input molecule,null
otherwise.Returns the input molecule.void
setFingerprint
(int[] fingerprint) Sets the fingerprint of the input molecule.void
setMolecule
(Molecule mol) Sets the input molecule.void
setSupplier
(Supplier<Molecule> supplier) 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
-
MOL
- See Also:
-
FINGERPRINT
- See Also:
-
-
Constructor Details
-
MolContext
public MolContext()Constructor. -
MolContext
Creates a MolContext with the given input molecule.- Since:
- Marvin 5.2
-
-
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 {"mol", "fingerprint"}. This is the accessor function name for getting the molecule.- Specified by:
getContextFunctionNames
in interfaceChemContext
- Returns:
- {"mol", "fingerprint"}
-
callContextFunction
Executes the specified context function with the given parameters.Implemented functions:
name parameter return value "mol" the input molecule "fingerprint" the input molecule fingerprint - 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
-
setMolecule
Sets the input molecule.- Parameters:
mol
- is the input molecule
-
setSupplier
-
getMolecule
Returns the input molecule.- Returns:
- the input molecule
-
setFingerprint
public void setFingerprint(int[] fingerprint) Sets the fingerprint of the input molecule.- Parameters:
fingerprint
- is the fingerprint
-
getFingerprint
public int[] getFingerprint()Returns the input molecule fingerprint.- Returns:
- the input molecule fingerprint
-
getFingerprint
Returns the input molecule fingerprint if argument is the input molecule,null
otherwise.- Parameters:
arg
- is the argument to be checked against the input molecule- Returns:
- the input molecule fingerprint or
null
-
clear
public void clear()Clears the context.- Specified by:
clear
in interfaceChemContext
-
ChemContext.ProvidesFunction
annotation instead.