Package weka.core.converters
Class AbstractFileLoader
java.lang.Object
weka.core.converters.AbstractLoader
weka.core.converters.AbstractFileLoader
- All Implemented Interfaces:
Serializable,FileSourcedConverter,Loader,EnvironmentHandler,RevisionHandler
- Direct Known Subclasses:
ArffLoader,C45Loader,CSVLoader,JSONLoader,LibSVMLoader,MatlabLoader,SerializedInstancesLoader,SVMLightLoader,XRFFLoader
public abstract class AbstractFileLoader
extends AbstractLoader
implements FileSourcedConverter, EnvironmentHandler
Abstract superclass for all file loaders.
- Version:
- $Revision: 14945 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface weka.core.converters.Loader
Loader.StructureNotReadyException -
Field Summary
FieldsFields inherited from interface weka.core.converters.Loader
BATCH, INCREMENTAL, NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets whether relative paths are to be usedvoidreset()Resets the loader ready to read a new data setget the File specified as the sourcestatic voidrunFileLoader(AbstractFileLoader loader, String[] options) runs the given loader with the provided optionsvoidSet the environment variables to use.voidsets the source FilevoidResets the Loader object and sets the source of the data set to be the supplied File object.voidsetUseRelativePath(boolean rp) Set whether to use relative rather than absolute pathsTip text suitable for displaying int the GUIMethods inherited from class weka.core.converters.AbstractLoader
getDataSet, getNextInstance, getStructure, setRetrieval, setSourceMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface weka.core.converters.FileSourcedConverter
getFileDescription, getFileExtension, getFileExtensionsMethods inherited from interface weka.core.RevisionHandler
getRevision
-
Field Details
-
FILE_EXTENSION_COMPRESSED
the extension for compressed files
-
-
Constructor Details
-
AbstractFileLoader
public AbstractFileLoader()
-
-
Method Details
-
retrieveFile
get the File specified as the source- Specified by:
retrieveFilein interfaceFileSourcedConverter- Returns:
- the source file
-
setFile
sets the source File- Specified by:
setFilein interfaceFileSourcedConverter- Parameters:
file- the source file- Throws:
IOException- if an error occurs
-
setEnvironment
Set the environment variables to use.- Specified by:
setEnvironmentin interfaceEnvironmentHandler- Parameters:
env- the environment variables to use
-
reset
Resets the loader ready to read a new data set- Specified by:
resetin interfaceLoader- Overrides:
resetin classAbstractLoader- Throws:
IOException- if something goes wrong
-
setSource
Resets the Loader object and sets the source of the data set to be the supplied File object.- Specified by:
setSourcein interfaceLoader- Overrides:
setSourcein classAbstractLoader- Parameters:
file- the source file.- Throws:
IOException- if an error occurs
-
useRelativePathTipText
Tip text suitable for displaying int the GUI- Returns:
- a description of this property as a String
-
setUseRelativePath
public void setUseRelativePath(boolean rp) Set whether to use relative rather than absolute paths- Specified by:
setUseRelativePathin interfaceFileSourcedConverter- Parameters:
rp- true if relative paths are to be used
-
getUseRelativePath
public boolean getUseRelativePath()Gets whether relative paths are to be used- Specified by:
getUseRelativePathin interfaceFileSourcedConverter- Returns:
- true if relative paths are to be used
-
runFileLoader
runs the given loader with the provided options- Parameters:
loader- the loader to runoptions- the commandline options, first argument must be the file to load
-