Package weka.core.converters
Class ConverterUtils
java.lang.Object
weka.core.converters.ConverterUtils
- All Implemented Interfaces:
Serializable,RevisionHandler
Utility routines for the converter package.
- Version:
- $Revision: 15666 $
- Author:
- Mark Hall (mhall@cs.waikato.ac.nz), FracPete (fracpete at waikato dot ac dot nz)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHelper class for saving data to files.static classHelper class for loading data from files and URLs. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiderrms(StreamTokenizer tokenizer, String theMsg) Throws error message with line number and last token read.returns a vector with the classnames of all the file loaders.returns a vector with the classnames of all the file savers.static voidgetFirstToken(StreamTokenizer tokenizer) Gets token, skipping empty lines.static AbstractFileLoadergetLoaderForExtension(String extension) tries to determine the loader to use for this kind of extension, returns null if none can be found.static AbstractFileLoadergetLoaderForFile(File file) tries to determine the loader to use for this kind of file, returns null if none can be found.static AbstractFileLoadergetLoaderForFile(String filename) tries to determine the loader to use for this kind of file, returns null if none can be found.static List<AbstractFileLoader>getLoadersForExtension(String extension) tries to determine the loader to use for this kind of extension, returns null if none can be found.static List<AbstractFileLoader>getLoadersForFile(File file) tries to determine the loaders to use for this kind of file.static List<AbstractFileLoader>getLoadersForFile(String filename) tries to determine the loaders to use for this kind of file.Returns the revision string.static AbstractFileSavergetSaverForExtension(String extension) tries to determine the saver to use for this kind of extension, returns null if none can be found.static AbstractFileSavergetSaverForFile(File file) tries to determine the saver to use for this kind of file, returns null if none can be found.static AbstractFileSavergetSaverForFile(String filename) tries to determine the saver to use for this kind of file, returns null if none can be found.static List<AbstractFileSaver>getSaversForExtension(String extension) tries to determine the savers to use for this kind of extension.static List<AbstractFileSaver>getSaversForFile(File file) tries to determine the savers to use for this kind of file.static List<AbstractFileSaver>getSaversForFile(String filename) tries to determine the savers to use for this kind of file.static voidgetToken(StreamTokenizer tokenizer) Gets token.returns a vector with the classnames of all the URL file loaders.static AbstractFileLoadergetURLLoaderForExtension(String extension) tries to determine the URL loader to use for this kind of extension, returns null if none can be found.static AbstractFileLoadergetURLLoaderForFile(File file) tries to determine the URL loader to use for this kind of file, returns null if none can be found.static AbstractFileLoadergetURLLoaderForFile(String filename) tries to determine the URL loader to use for this kind of file, returns null if none can be found.static List<AbstractFileLoader>getURLLoadersForExtension(String extension) tries to determine the URL loaders to use for this kind of extension.static List<AbstractFileLoader>getURLLoadersForFile(File file) tries to determine the URL loaders to use for this kind of file.static List<AbstractFileLoader>getURLLoadersForFile(String filename) tries to determine the URL loader to use for this kind of file.static void
-
Constructor Details
-
ConverterUtils
public ConverterUtils()
-
-
Method Details
-
initialize
public static void initialize() -
getFirstToken
Gets token, skipping empty lines.- Parameters:
tokenizer- the stream tokenizer- Throws:
IOException- if reading the next token fails
-
getToken
Gets token.- Parameters:
tokenizer- the stream tokenizer- Throws:
IOException- if reading the next token fails
-
errms
Throws error message with line number and last token read.- Parameters:
theMsg- the error message to be throwntokenizer- the stream tokenizer- Throws:
IOException- containing the error message
-
getFileLoaders
returns a vector with the classnames of all the file loaders.- Returns:
- the classnames of the loaders
-
getLoaderForFile
tries to determine the loader to use for this kind of file, returns null if none can be found.- Parameters:
filename- the file to return a converter for- Returns:
- the converter if one was found, null otherwise
-
getLoadersForFile
tries to determine the loaders to use for this kind of file.- Parameters:
filename- the file to return converters for- Returns:
- the converters, list is empty if none found
-
getLoaderForFile
tries to determine the loader to use for this kind of file, returns null if none can be found.- Parameters:
file- the file to return a converter for- Returns:
- the converter if one was found, null otherwise
-
getLoadersForFile
tries to determine the loaders to use for this kind of file.- Parameters:
file- the file to return converters for- Returns:
- the converters, empty list if none found
-
getLoaderForExtension
tries to determine the loader to use for this kind of extension, returns null if none can be found.- Parameters:
extension- the file extension to return a converter for- Returns:
- the converter if one was found, null otherwise
-
getLoadersForExtension
tries to determine the loader to use for this kind of extension, returns null if none can be found.- Parameters:
extension- the file extension to return a converter for- Returns:
- the converter if one was found, null otherwise
-
getURLFileLoaders
returns a vector with the classnames of all the URL file loaders.- Returns:
- the classnames of the loaders
-
getURLLoaderForFile
tries to determine the URL loader to use for this kind of file, returns null if none can be found.- Parameters:
filename- the file to return a URL converter for- Returns:
- the converter if one was found, null otherwise
-
getURLLoadersForFile
tries to determine the URL loader to use for this kind of file.- Parameters:
filename- the file to return URL converters for- Returns:
- the converters, empty list if none found
-
getURLLoaderForFile
tries to determine the URL loader to use for this kind of file, returns null if none can be found.- Parameters:
file- the file to return a URL converter for- Returns:
- the converter if one was found, null otherwise
-
getURLLoadersForFile
tries to determine the URL loaders to use for this kind of file.- Parameters:
file- the file to return URL converters for- Returns:
- the converters, empty list if none found
-
getURLLoaderForExtension
tries to determine the URL loader to use for this kind of extension, returns null if none can be found.- Parameters:
extension- the file extension to return a URL converter for- Returns:
- the converter if one was found, null otherwise
-
getURLLoadersForExtension
tries to determine the URL loaders to use for this kind of extension.- Parameters:
extension- the file extension to return URL converters for- Returns:
- the converters, empty list of none found
-
getFileSavers
returns a vector with the classnames of all the file savers.- Returns:
- the classnames of the savers
-
getSaverForFile
tries to determine the saver to use for this kind of file, returns null if none can be found.- Parameters:
filename- the file to return a converter for- Returns:
- the converter if one was found, null otherwise
-
getSaversForFile
tries to determine the savers to use for this kind of file.- Parameters:
filename- the file to return converters for- Returns:
- the converters, empty list if none found
-
getSaverForFile
tries to determine the saver to use for this kind of file, returns null if none can be found.- Parameters:
file- the file to return a converter for- Returns:
- the converter if one was found, null otherwise
-
getSaversForFile
tries to determine the savers to use for this kind of file.- Parameters:
file- the file to return converters for- Returns:
- the converters, empty list if none found
-
getSaverForExtension
tries to determine the saver to use for this kind of extension, returns null if none can be found.- Parameters:
extension- the file extension to return a converter for- Returns:
- the converter if one was found, null otherwise
-
getSaversForExtension
tries to determine the savers to use for this kind of extension.- Parameters:
extension- the file extension to return converters for- Returns:
- the converters, empty list if none found
-
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-