⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 abstractsaver.java

📁 MacroWeka扩展了著名数据挖掘工具weka
💻 JAVA
字号:
package chen.macroweka.core.converters;

import weka.core.Instances;

import java.io.File;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Abstract class gives default implementation of setSource
 * methods. All other methods must be overridden.
 *
 */
public abstract class AbstractSaver implements Saver
{

    /**
     * Default implementation throws an IOException.
     *
     * @param file the File
     * @throws IOException always
     */
    public void setDestination(File file) throws IOException
    {
        throw new IOException( "Setting File as source not supported" );
    }

    /**
     * Default implementation throws an IOException.
     *
     * @param input the input stream
     * @throws IOException always
     */
    public void setDestination(OutputStream input) throws IOException
    {
        throw new IOException( "Setting InputStream as source not supported" );
    }

    public void beginSave()
    {
        // Empty implementation
    }

    public void endSave() throws IOException
    {
        // Empty implementation
    }

    /**
     * Saves the structure (internally the header) of the data set.
     *
     * @param instances the set of Instances
     * @throws IOException if there is no source or saving fails
     */
    public abstract void saveStructure(Instances instances) throws IOException;

    /**
     * Save the full data set.
     *
     * @param instances the full data set as an Instances object
     * @throws IOException if there is an error during saving
     */
    public abstract void saveDataSet(Instances instances) throws Exception;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -