|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.converters.AbstractLoader
Abstract class gives default implementation of setSource methods. All other methods must be overridden.
Field Summary | |
protected static int |
BATCH
|
protected static int |
INCREMENTAL
|
protected int |
m_retrieval
The current retrieval mode |
protected static int |
NONE
The retrieval modes |
Constructor Summary | |
AbstractLoader()
|
Method Summary | |
abstract Instances |
getDataSet()
Return the full data set. |
abstract Instance |
getNextInstance()
Read the data set incrementally---get the next instance in the data set or returns null if there are no more instances to get. |
protected int |
getRetrieval()
Gets the retrieval mode. |
abstract Instances |
getStructure()
Determines and returns (if possible) the structure (internally the header) of the data set as an empty set of instances. |
protected void |
setRetrieval(int mode)
Sets the retrieval mode. |
void |
setSource(java.io.File file)
Default implementation throws an IOException. |
void |
setSource(java.io.InputStream input)
Default implementation throws an IOException. |
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)
mode
- the retrieval modeprotected int getRetrieval()
public void setSource(java.io.File file) throws java.io.IOException
setSource
in interface Loader
file
- the File
java.io.IOException
- alwayspublic void setSource(java.io.InputStream input) throws java.io.IOException
setSource
in interface Loader
input
- the input stream
java.io.IOException
- alwayspublic abstract Instances getStructure() throws java.io.IOException
Loader
getStructure
in interface Loader
java.io.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 java.io.IOException
Loader
getDataSet
in interface Loader
java.io.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 java.io.IOException
Loader
getNextInstance
in interface Loader
java.io.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 |