本文整理汇总了Java中weka.gui.beans.PluginManager类的典型用法代码示例。如果您正苦于以下问题:Java PluginManager类的具体用法?Java PluginManager怎么用?Java PluginManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PluginManager类属于weka.gui.beans包,在下文中一共展示了PluginManager类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPluginMetrics
import weka.gui.beans.PluginManager; //导入依赖的package包/类
/**
* Gets a list of freshly instantiated concrete implementations of available
* plugin metrics or null if there are no plugin metrics available
*
* @return a list of plugin metrics or null if there are no plugin metrics
*/
public static ArrayList<AbstractEvaluationMetric> getPluginMetrics() {
ArrayList<AbstractEvaluationMetric> pluginMetricsList = null;
Set<String> pluginMetrics =
PluginManager.getPluginNamesOfType(AbstractEvaluationMetric.class
.getName());
if (pluginMetrics != null) {
pluginMetricsList = new ArrayList<AbstractEvaluationMetric>();
for (String metric : pluginMetrics) {
try {
Object impl =
PluginManager.getPluginInstance(
AbstractEvaluationMetric.class.getName(), metric);
if (impl instanceof AbstractEvaluationMetric) {
pluginMetricsList.add((AbstractEvaluationMetric) impl);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
return pluginMetricsList;
}
示例2: getClassnames
import weka.gui.beans.PluginManager; //导入依赖的package包/类
/**
* Returns the available classnames for a certain property in the props file.
*
* @param property the property to get the classnames for
* @return the classnames
*/
public static Vector<String> getClassnames(String property) {
Vector<String> result;
Set<String> r = PluginManager.getPluginNamesOfType(property);
result = new Vector<String>();
if (r != null) {
result.addAll(r);
}
Collections.sort(result, new ClassDiscovery.StringCompare());
return result;
}
示例3: processPluginManagerProps
import weka.gui.beans.PluginManager; //导入依赖的package包/类
/**
* Process a package's PluginManager.props file
*
* @param propsFile the properties file to process
*/
protected static void processPluginManagerProps(File propsFile) {
try {
PluginManager.addFromProperties(propsFile);
} catch (Exception ex) {
}
}
示例4: getClassesFromProperties
import weka.gui.beans.PluginManager; //导入依赖的package包/类
/**
* Called when the class of object being edited changes.
*
* @return the hashtable containing the HierarchyPropertyParsers for the root
* elements
*/
protected Hashtable<String, HierarchyPropertyParser> getClassesFromProperties() {
Hashtable<String, HierarchyPropertyParser> hpps = new Hashtable<String, HierarchyPropertyParser>();
String className = m_ClassType.getName();
Set<String> cls = PluginManager.getPluginNamesOfType(className);
if (cls == null) {
return hpps;
}
List<String> toSort = new ArrayList<String>(cls);
Collections.sort(toSort, new ClassDiscovery.StringCompare());
StringBuilder b = new StringBuilder();
for (String s : toSort) {
b.append(s).append(",");
}
String listS = b.substring(0, b.length() - 1);
// Hashtable typeOptions =
// sortClassesByRoot(EDITOR_PROPERTIES.getProperty(className));
Hashtable<String, String> typeOptions = sortClassesByRoot(listS);
if (typeOptions == null) {
/*
* System.err.println("Warning: No configuration property found in\n" +
* PROPERTY_FILE + "\n" + "for " + className);
*/
} else {
try {
Enumeration<String> enm = typeOptions.keys();
while (enm.hasMoreElements()) {
String root = enm.nextElement();
String typeOption = typeOptions.get(root);
HierarchyPropertyParser hpp = new HierarchyPropertyParser();
hpp.build(typeOption, ", ");
hpps.put(root, hpp);
}
} catch (Exception ex) {
Logger.log(weka.core.logging.Logger.Level.WARNING, "Invalid property: "
+ typeOptions);
}
}
return hpps;
}