类 ConverterUtils.DataSink

java.lang.Object
weka.core.converters.ConverterUtils.DataSink
所有已实现的接口:
Serializable, RevisionHandler
封闭类:
ConverterUtils

public static class ConverterUtils.DataSink extends Object implements Serializable, RevisionHandler
Helper class for saving data to files. Via the ConverterUtils class it determines which converter to use for saving the data. It is the logical counterpart to DataSource.
版本:
$Revision: 6416 $
作者:
FracPete (fracpete at waikato dot ac dot nz)
另请参阅:
  • 构造器概要

    构造器
    构造器
    说明
    initializes the sink to save the data in the stream (always in ARFF format).
    DataSink(String filename)
    initializes the sink to save the data to the given file.
    DataSink(Saver saver)
    initializes the sink to save the data to the given Saver (expected to be fully configured).
  • 方法概要

    修饰符和类型
    方法
    说明
    Returns the revision string.
    static void
    main(String[] args)
    for testing only - takes a data file as input and a data file for the output.
    static void
    write(OutputStream stream, Instances data)
    writes the data to the given stream (always in ARFF format).
    static void
    write(String filename, Instances data)
    writes the data to the given file.
    static void
    write(Saver saver, Instances data)
    writes the data via the given saver.
    void
    writes the given data either via the saver or to the defined output stream (depending on the constructor).

    从类继承的方法 java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • DataSink

      public DataSink(String filename) throws Exception
      initializes the sink to save the data to the given file.
      参数:
      filename - the file to save data to
      抛出:
      Exception - if set of saver fails
    • DataSink

      public DataSink(Saver saver)
      initializes the sink to save the data to the given Saver (expected to be fully configured).
      参数:
      saver - the saver to use for saving the data
    • DataSink

      public DataSink(OutputStream stream)
      initializes the sink to save the data in the stream (always in ARFF format).
      参数:
      stream - the output stream to use for storing the data in ARFF format
  • 方法详细资料

    • write

      public void write(Instances data) throws Exception
      writes the given data either via the saver or to the defined output stream (depending on the constructor). In case of the stream, the stream is only flushed, but not closed.
      参数:
      data - the data to save
      抛出:
      Exception - if saving fails
    • write

      public static void write(String filename, Instances data) throws Exception
      writes the data to the given file.
      参数:
      filename - the file to write the data to
      data - the data to store
      抛出:
      Exception - if writing fails
    • write

      public static void write(Saver saver, Instances data) throws Exception
      writes the data via the given saver.
      参数:
      saver - the saver to use for writing the data
      data - the data to store
      抛出:
      Exception - if writing fails
    • write

      public static void write(OutputStream stream, Instances data) throws Exception
      writes the data to the given stream (always in ARFF format).
      参数:
      stream - the stream to write the data to (ARFF format)
      data - the data to store
      抛出:
      Exception - if writing fails
    • main

      public static void main(String[] args) throws Exception
      for testing only - takes a data file as input and a data file for the output.
      参数:
      args - the commandline arguments
      抛出:
      Exception - if something goes wrong
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      返回:
      the revision