类 AbstractLoader

java.lang.Object
weka.core.converters.AbstractLoader
所有已实现的接口:
Serializable, Loader, RevisionHandler
直接已知子类:
AbstractFileLoader, DatabaseLoader, TextDirectoryLoader

public abstract class AbstractLoader extends Object implements Loader
Abstract class gives default implementation of setSource methods. All other methods must be overridden.
版本:
$Revision: 7454 $
作者:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • AbstractLoader

      public AbstractLoader()
  • 方法详细资料

    • setRetrieval

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

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

      public void reset() throws Exception
      Default implementation sets retrieval mode to NONE
      指定者:
      reset 在接口中 Loader
      抛出:
      Exception - if Loader can't be reset for some reason.
    • setSource

      public void setSource(InputStream input) throws IOException
      Default implementation throws an IOException.
      指定者:
      setSource 在接口中 Loader
      参数:
      input - the input stream
      抛出:
      IOException - always
    • getStructure

      public abstract Instances getStructure() throws IOException
      从接口复制的说明: Loader
      Determines and returns (if possible) the structure (internally the header) of the data set as an empty set of instances.
      指定者:
      getStructure 在接口中 Loader
      返回:
      the structure of the data set as an empty set of Instances
      抛出:
      IOException - if there is no source or parsing fails
      
          public_normal_behavior
            requires: model_sourceSupplied == true
                      && model_structureDetermined == false
                      && (* successful parse *);
            modifiable: model_structureDetermined;
            ensures: \result != null
                     && \result.numInstances() == 0
                     && model_structureDetermined == true;
        also
          public_exceptional_behavior
            requires: model_sourceSupplied == false
                      || (* unsuccessful parse *);
            signals: (IOException);
       
    • getDataSet

      public abstract Instances getDataSet() throws IOException
      从接口复制的说明: Loader
      Return the full data set. If the structure hasn't yet been determined by a call to getStructure then the method should do so before processing the rest of the data set.
      指定者:
      getDataSet 在接口中 Loader
      返回:
      the full data set as an Instances object
      抛出:
      IOException - if there is an error during parsing or if getNextInstance has been called on this source (either incremental or batch loading can be used, not both).
      
          public_normal_behavior
            requires: model_sourceSupplied == true
                      && (* successful parse *);
            modifiable: model_structureDetermined;
            ensures: \result != null
                     && \result.numInstances() >= 0
                     && model_structureDetermined == true;
        also
          public_exceptional_behavior
            requires: model_sourceSupplied == false
                      || (* unsuccessful parse *);
            signals: (IOException);
       
    • getNextInstance

      public abstract Instance getNextInstance(Instances structure) throws IOException
      从接口复制的说明: Loader
      Read the data set incrementally---get the next instance in the data set or returns null if there are no more instances to get. If the structure hasn't yet been determined by a call to getStructure then method should do so before returning the next instance in the data set. If it is not possible to read the data set incrementally (ie. in cases where the data set structure cannot be fully established before all instances have been seen) then an exception should be thrown.
      指定者:
      getNextInstance 在接口中 Loader
      参数:
      structure - the dataset header information, will get updated in case of string or relational attributes
      返回:
      the next instance in the data set as an Instance object or null if there are no more instances to be read
      抛出:
      IOException - if there is an error during parsing or if getDataSet has been called on this source (either incremental or batch loading can be used, not both).