类 AbstractSaver

java.lang.Object
weka.core.converters.AbstractSaver
所有已实现的接口:
Serializable, CapabilitiesHandler, Saver, RevisionHandler
直接已知子类:
AbstractFileSaver, DatabaseSaver

public abstract class AbstractSaver extends Object implements Saver, CapabilitiesHandler
Abstract class for Saver
版本:
$Revision: 1.4 $
作者:
Richard Kirkby (rkirkby@cs.waikato.ac.nz), Stefan Mutter (mutter@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • AbstractSaver

      public AbstractSaver()
  • 方法详细资料

    • resetOptions

      public void resetOptions()
      resets the options
    • resetStructure

      public void resetStructure()
      Resets the structure (header information of the instances)
    • setRetrieval

      public void setRetrieval(int mode)
      Sets the retrieval mode.
      指定者:
      setRetrieval 在接口中 Saver
      参数:
      mode - the retrieval mode
    • getWriteMode

      public int getWriteMode()
      Gets the write mode.
      指定者:
      getWriteMode 在接口中 Saver
      返回:
      the write mode
    • setInstances

      public void setInstances(Instances instances)
      Sets instances that should be stored.
      指定者:
      setInstances 在接口中 Saver
      参数:
      instances - the instances
    • getInstances

      public Instances getInstances()
      Gets instances that should be stored.
      返回:
      the instances
    • setDestination

      public void setDestination(File file) throws IOException
      Default implementation throws an IOException.
      指定者:
      setDestination 在接口中 Saver
      参数:
      file - the File
      抛出:
      IOException - always
    • setDestination

      public void setDestination(OutputStream output) throws IOException
      Default implementation throws an IOException.
      指定者:
      setDestination 在接口中 Saver
      参数:
      output - the OutputStream
      抛出:
      IOException - always
    • getCapabilities

      public Capabilities getCapabilities()
      Returns the Capabilities of this saver. Derived savers have to override this method to enable capabilities.
      指定者:
      getCapabilities 在接口中 CapabilitiesHandler
      返回:
      the capabilities of this object
      另请参阅:
    • setStructure

      public int setStructure(Instances headerInfo)
      Sets the strcuture of the instances for the first step of incremental saving. The instances only need to have a header.
      参数:
      headerInfo - an instances object.
      返回:
      the appropriate write mode
    • cancel

      public void cancel()
      Cancels the incremental saving process if the write mode is CANCEL.
    • writeIncremental

      public void writeIncremental(Instance i) throws IOException
      Method for incremental saving. Standard behaviour: no incremental saving is possible, therefore throw an IOException. An incremental saving process is stopped by calling this method with null.
      指定者:
      writeIncremental 在接口中 Saver
      参数:
      i - the instance to be saved
      抛出:
      IOException - IOEXception if the instance acnnot be written to the specified destination
    • writeBatch

      public abstract void writeBatch() throws IOException
      Writes to a file in batch mode To be overridden.
      指定者:
      writeBatch 在接口中 Saver
      抛出:
      IOException - exception if writting is not possible
    • getFileExtension

      public String getFileExtension() throws Exception
      Default implementation throws an IOException.
      指定者:
      getFileExtension 在接口中 Saver
      返回:
      a string conatining the file extension (including the '.')
      抛出:
      IOException - always
      Exception - exception if a Saver not implementing FileSourcedConverter is used.
    • setFile

      public void setFile(File file) throws IOException
      Default implementation throws an IOException.
      指定者:
      setFile 在接口中 Saver
      参数:
      file - the File
      抛出:
      IOException - always
    • setFilePrefix

      public void setFilePrefix(String prefix) throws Exception
      Default implementation throws an IOException.
      指定者:
      setFilePrefix 在接口中 Saver
      参数:
      prefix - the file prefix
      抛出:
      IOException - always
      Exception - exception if a Saver not implementing FileSourcedConverter is used.
    • filePrefix

      public String filePrefix() throws Exception
      Default implementation throws an IOException.
      指定者:
      filePrefix 在接口中 Saver
      返回:
      the prefix of the file name
      抛出:
      IOException - always
      Exception - exception if a Saver not implementing FileSourcedConverter is used.
    • setDir

      public void setDir(String dir) throws IOException
      Default implementation throws an IOException.
      指定者:
      setDir 在接口中 Saver
      参数:
      dir - the name of the directory to save in
      抛出:
      IOException - always
    • setDirAndPrefix

      public void setDirAndPrefix(String relationName, String add) throws IOException
      Default implementation throws an IOException.
      指定者:
      setDirAndPrefix 在接口中 Saver
      参数:
      relationName -
      add -
      抛出:
      IOException - always
    • retrieveDir

      public String retrieveDir() throws IOException
      Default implementation throws an IOException.
      指定者:
      retrieveDir 在接口中 Saver
      返回:
      the directory as a string
      抛出:
      IOException - always