chemaxon.jep
Class ChemContext

java.lang.Object
  extended by chemaxon.jep.ChemContext
All Implemented Interfaces:
chemaxon.marvin.util.CallbackIface, java.io.Serializable
Direct Known Subclasses:
MolContext, ReactionContext

public class ChemContext
extends java.lang.Object
implements chemaxon.marvin.util.CallbackIface, java.io.Serializable

Common base class of expression evaluation contexts. Provides function names for accessing context elements through the CallbackIface.

Since:
JChem 2.2, Marvin 5.1
Author:
Nora Mate
See Also:
Serialized Form

Constructor Summary
ChemContext()
          Constructor.
 
Method Summary
 java.lang.Object callback(java.lang.String method, java.lang.Object arg)
          Implements CallbackIface.
 void clear()
          Clears the context.
 java.lang.String[] getContextFunctionNames()
          Returns context element accessor function names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChemContext

public ChemContext()
Constructor.

Method Detail

getContextFunctionNames

public java.lang.String[] getContextFunctionNames()
Returns context element accessor function names. The default implementation returns null. Subclasses override this method to add specific context elements accessors.

Returns:
the context element accessor function names

callback

public java.lang.Object callback(java.lang.String method,
                                 java.lang.Object arg)
Implements CallbackIface. The default implementation does nothing and returns null. Subclasses override this method to implement the specific context elements accessors returned by getContextFunctionNames().

Specified by:
callback in interface chemaxon.marvin.util.CallbackIface
Parameters:
method - is the accessor method name (returned by getContextFunctionNames())
arg - 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)
Returns:
the context element

clear

public void clear()
Clears the context.