|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.core.converters.AbstractLoader
Abstract class for Loaders that contains default implementation of the setSource methods: Any of these methods that are not overwritten will result in throwing IOException.
Field Summary | |
protected static int |
BATCH
For representing that instances have been retrieved in batch mode |
protected static int |
INCREMENTAL
For representing that instances have been retrieved incrementally |
protected int |
m_Retrieval
|
protected static int |
NONE
For state where no instances have been retrieved yet |
Constructor Summary | |
AbstractLoader()
|
Method Summary | |
abstract Instances |
getDataSet()
Must be overridden by subclasses. |
abstract Instance |
getNextInstance()
Must be overridden by subclasses. |
protected int |
getRetrieval()
|
abstract Instances |
getStructure()
Must be overridden by subclasses. |
protected void |
setRetrieval(int mode)
|
void |
setSource(File file)
Resets the Loader object and sets the source of the data set to be the supplied File object. |
void |
setSource(InputStream input)
Resets the Loader object and sets the source of the data set to be the supplied InputStream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int NONE
protected static final int BATCH
protected static final int INCREMENTAL
protected int m_Retrieval
Constructor Detail |
public AbstractLoader()
Method Detail |
protected void setRetrieval(int mode)
protected int getRetrieval()
public void setSource(File file) throws IOException
setSource
in interface Loader
file
- the File.
IOException
- always thrown.public void setSource(InputStream input) throws IOException
setSource
in interface Loader
input
- the source InputStream.
IOException
- always thrown.public abstract Instances getStructure() throws IOException
getStructure
in interface Loader
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);
public abstract Instances getDataSet() throws IOException
getDataSet
in interface Loader
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);
public abstract Instance getNextInstance() throws IOException
getNextInstance
in interface Loader
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).
public_normal_behavior {| requires: model_sourceSupplied == true && (* successful parse *); modifiable: model_structureDetermined; ensures: model_structureDetermined == true && \result != null; also requires: model_sourceSupplied == true && (* no further input *); modifiable: model_structureDetermined; ensures: model_structureDetermined == true && \result == null; |} also public_exceptional_behavior {| requires: model_sourceSupplied == false || (* unsuccessful parse *); signals: (IOException); also requires: (* unable to process data set incrementally *); signals: (IOException); |}
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |