本文整理汇总了Java中weka.core.scripting.Groovy类的典型用法代码示例。如果您正苦于以下问题:Java Groovy类的具体用法?Java Groovy怎么用?Java Groovy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Groovy类属于weka.core.scripting包,在下文中一共展示了Groovy类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doRun
import weka.core.scripting.Groovy; //导入依赖的package包/类
/**
* Performs the actual run.
*/
protected void doRun() {
Object groovy;
groovy = Groovy.newInstance(m_Owner.getFilename(), Object.class);
if (hasMethod(groovy, "run"))
Groovy.invoke(groovy, "run", new Class[]{String[].class}, new Object[]{getArgs()});
else if (hasMethod(groovy, "main"))
Groovy.invoke(groovy, "main", new Class[]{String[].class}, new Object[]{getArgs()});
else
throw new IllegalStateException("Neither 'run' nor 'main' method found!");
}
示例2: preCheck
import weka.core.scripting.Groovy; //导入依赖的package包/类
/**
* Performs pre-execution checks.
* <p/>
* This method checks whether Groovy is available (throws an exception if not).
*
* @param args optional commandline arguments
* @throws Exception if checks fail
*/
protected void preCheck(String[] args) throws Exception {
super.preCheck(args);
if (!Groovy.isPresent())
throw new Exception("Groovy classes are not present in CLASSPATH!");
}
示例3: canExecuteScripts
import weka.core.scripting.Groovy; //导入依赖的package包/类
/**
* Returns whether scripts can be executed, i.e., Groovy is present.
*
* @return true if scripts can be executed
*/
protected boolean canExecuteScripts() {
return Groovy.isPresent();
}