程序包 weka.core
类 Jython
java.lang.Object
weka.core.Jython
- 所有已实现的接口:
Serializable
,RevisionHandler
A helper class for Jython.
- 版本:
- $Revision: 1.2 $
- 作者:
- fracpete (fracpete at waikato dot ac dot nz)
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static Object
deserializes the Python Object from the streamreturns the currently used Python InterpreterReturns the revision string.static Object
executes the specified method and returns the result, if anyexecutes the specified method on the current interpreter and returns the result, if anystatic boolean
returns whether the Jython classes are present or not, i.e.static void
If no arguments are given, it just prints the presence of the Jython classes, otherwise it expects a Jython filename to execute.static Object
newInstance
(File file, Class template) loads the module and returns a new instance of it as instance of the provided Java class template.static Object
newInstance
(File file, Class template, File[] paths) loads the module and returns a new instance of it as instance of the provided Java class template.static Object
initializes and returns a Python Interpreter
-
字段详细资料
-
构造器详细资料
-
Jython
public Jython()default constructor, tries to instantiate a Python Interpreter
-
-
方法详细资料
-
getInterpreter
returns the currently used Python Interpreter- 返回:
- the interpreter, can be null
-
invoke
executes the specified method on the current interpreter and returns the result, if any- 参数:
o
- the object the method should be called from, e.g., a Python InterpretermethodName
- the name of the methodparamClasses
- the classes of the parametersparamValues
- the values of the parameters- 返回:
- the return value of the method, if any (in that case null)
-
isPresent
public static boolean isPresent()returns whether the Jython classes are present or not, i.e. whether the classes are in the classpath or not- 返回:
- whether the Jython classes are available
-
newInterpreter
initializes and returns a Python Interpreter- 返回:
- the interpreter or null if Jython classes not present
-
newInstance
loads the module and returns a new instance of it as instance of the provided Java class template.- 参数:
filename
- the path to the Jython module, incl. filenametemplate
- the template for the returned Java object- 返回:
- the Jython object
-
newInstance
loads the module and returns a new instance of it as instance of the provided Java class template. The paths are added to 'sys.path' - can be used if the module depends on other Jython modules.- 参数:
filename
- the path to the Jython module, incl. filenametemplate
- the template for the returned Java objectpaths
- additional paths to add to "sys.path"- 返回:
- the Jython object
-
invoke
public static Object invoke(Object o, String methodName, Class[] paramClasses, Object[] paramValues) executes the specified method and returns the result, if any- 参数:
o
- the object the method should be called from, e.g., a Python InterpretermethodName
- the name of the methodparamClasses
- the classes of the parametersparamValues
- the values of the parameters- 返回:
- the return value of the method, if any (in that case null)
-
deserialize
deserializes the Python Object from the stream- 参数:
in
- the stream to use- 返回:
- the deserialized object
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-
main
If no arguments are given, it just prints the presence of the Jython classes, otherwise it expects a Jython filename to execute.- 参数:
args
- commandline arguments
-