|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Loader
Interface to something that can load Instances from an input source in some format.
Field Summary | |
---|---|
static int |
BATCH
|
static int |
INCREMENTAL
|
static int |
NONE
The retrieval modes |
Method Summary | |
---|---|
Instances |
getDataSet()
Return the full data set. |
Instance |
getNextInstance(Instances structure)
Read the data set incrementally---get the next instance in the data set or returns null if there are no more instances to get. |
Instances |
getStructure()
Determines and returns (if possible) the structure (internally the header) of the data set as an empty set of instances. |
void |
reset()
Resets the Loader object ready to begin loading. |
void |
setRetrieval(int mode)
Sets the retrieval mode. |
void |
setSource(java.io.File file)
Resets the Loader object and sets the source of the data set to be the supplied File object. |
void |
setSource(java.io.InputStream input)
Resets the Loader object and sets the source of the data set to be the supplied InputStream. |
Methods inherited from interface weka.core.RevisionHandler |
---|
getRevision |
Field Detail |
---|
static final int NONE
static final int BATCH
static final int INCREMENTAL
Method Detail |
---|
void setRetrieval(int mode)
mode
- the retrieval modevoid reset() throws java.lang.Exception
java.lang.Exception
- if Loader can't be reset for some reason.void setSource(java.io.File file) throws java.io.IOException
file
- the File
java.io.IOException
- if an error occurs
support loading from a File.
public_normal_behavior requires: file != null && (* file exists *); modifiable: model_sourceSupplied, model_structureDetermined; ensures: model_sourceSupplied == true && model_structureDetermined == false; also public_exceptional_behavior requires: file == null || (* file does not exist *); signals: (IOException);
void setSource(java.io.InputStream input) throws java.io.IOException
input
- the source InputStream
java.io.IOException
- if this Loader doesn't
support loading from a File.Instances getStructure() throws java.io.IOException
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);
Instances getDataSet() throws java.io.IOException
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);
Instance getNextInstance(Instances structure) throws java.io.IOException
structure
- the dataset header information, will get updated in
case of string or relational attributes
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).
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |