Package chemaxon.chemterms
Class MolContext
java.lang.Object
chemaxon.chemterms.MolContext
- All Implemented Interfaces:
ChemTermsContext
- Direct Known Subclasses:
AtomContext,SearchContext
@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 ChemTermsContext
Expression evaluation context containing a single molecule.
- 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
FieldsFields inherited from interface chemaxon.chemterms.ChemTermsContext
VARARG -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.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.voidclear()Clears the context.int[]Returns the input molecule fingerprint.protected int[]getFingerprint(Object arg) Returns the input molecule fingerprint if argument is the input molecule,nullotherwise.Returns the input molecule.voidsetFingerprint(int[] fingerprint) Sets the fingerprint of the input molecule.final voidsetMolecule(Molecule mol) Sets the input molecule.final voidsetSupplier(Supplier<Molecule> supplier) 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
-
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
-
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:
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
-
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,nullotherwise.- 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:
clearin interfaceChemTermsContext
-