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
Expression evaluation context containing a single molecule.
Provides function names for accessing context elements
through the
CallbackIface
.- Since:
- JChem 2.2, Marvin 5.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Creates a MolContext with the given input molecule. -
Method Summary
Modifier and TypeMethodDescriptionImplementsCallbackIface
.void
clear()
Clears the context.String[]
Returns {"mol", "fingerprint"}.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
(com.google.common.base.Supplier<Molecule> supplier)
-
Constructor Details
-
MolContext
public MolContext()Constructor. -
MolContext
Creates a MolContext with the given input molecule.- Since:
- Marvin 5.2
-
-
Method Details
-
getContextFunctionNames
Returns {"mol", "fingerprint"}. This is the accessor function name for getting the molecule.- Specified by:
getContextFunctionNames
in interfaceChemContext
- Returns:
- {"mol", "fingerprint"}
-
callback
ImplementsCallbackIface
. Returnsnull
for unimplemented callbacks. Implemented callbacks:method arg return value "mol" null
the input molecule "fingerprint" null
the input molecule fingerprint - Specified by:
callback
in interfacechemaxon.marvin.util.CallbackIface
- Specified by:
callback
in interfaceChemContext
- Parameters:
method
- is the accessor method namearg
- is the accessor method argument (the JEP parameter stack asnull
, a single parameter object or a parameter object array depending on the number of parameters on the stack)- Returns:
- the context element
-
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
-