Example usage for weka.core Capabilities getOwner

List of usage examples for weka.core Capabilities getOwner

Introduction

In this page you can find the example usage for weka.core Capabilities getOwner.

Prototype

public CapabilitiesHandler getOwner() 

Source Link

Document

returns the owner of this capabilities object

Usage

From source file:adams.data.conversion.WekaCapabilitiesToSpreadSheet.java

License:Open Source License

/**
 * Performs the actual conversion.// w w  w.j a v a  2  s .c  om
 *
 * @return      the converted data
 * @throws Exception   if something goes wrong with the conversion
 */
@Override
protected Object doConvert() throws Exception {
    SpreadSheet result;
    Capabilities caps;
    Row row;

    caps = (Capabilities) m_Input;
    result = new DefaultSpreadSheet();
    result.setName(OptionUtils.getCommandLine(caps.getOwner()));

    // header
    row = result.getHeaderRow();
    row.addCell("K").setContent("Capability");
    row.addCell("S").setContent("Supported");
    row.addCell("D").setContent("Dependency");

    // data
    for (Capability cap : Capability.values()) {
        row = result.addRow();
        row.addCell("K").setContentAsString(cap.toString());
        row.addCell("S").setContent(caps.handles(cap));
        row.addCell("D").setContent(caps.hasDependency(cap));
    }
    row = result.addRow();
    row.addCell("K").setContentAsString("Minimum # Instances ");
    row.addCell("S").setContent(caps.getMinimumNumberInstances());

    return result;
}