List of usage examples for weka.gui.beans PluginManager getPluginInstance
public static Object getPluginInstance(String interfaceType, String name) throws Exception
From source file:AbstractEvaluationMetric.java
License:Open Source License
/** * Gets a list of freshly instantiated concrete implementations of available * plugin metrics or null if there are no plugin metrics available * //w w w. ja v a 2 s . com * @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; }