Package weka.core.xml
Class KOML
java.lang.Object
weka.core.xml.KOML
- All Implemented Interfaces:
RevisionHandler
This class is a helper class for XML serialization using KOML .
KOML does not need to be present, since the class-calls are done generically
via Reflection.
- Version:
- $Revision 1.0$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
the extension for KOML files (including '.') -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the revision string.static boolean
returns whether KOML is present or not, i.e.static Object
reads the XML-serialized object from the given filestatic Object
read
(InputStream stream) reads the XML-serialized object from a streamstatic Object
reads the XML-serialized object from the given filestatic boolean
write the XML-serialized object to the given filestatic boolean
write
(OutputStream stream, Object o) writes the XML-serialized object to a streamstatic boolean
writes the XML-serialized object to the given file
-
Field Details
-
FILE_EXTENSION
the extension for KOML files (including '.')- See Also:
-
-
Constructor Details
-
KOML
public KOML()
-
-
Method Details
-
isPresent
public static boolean isPresent()returns whether KOML is present or not, i.e. whether the classes are in the classpath or not- Returns:
- whether KOML is available
-
read
reads the XML-serialized object from the given file- Parameters:
filename
- the file to deserialize the object from- Returns:
- the deserialized object
- Throws:
Exception
- if something goes wrong while reading from the file
-
read
reads the XML-serialized object from the given file- Parameters:
file
- the file to deserialize the object from- Returns:
- the deserialized object
- Throws:
Exception
- if something goes wrong while reading from the file
-
read
reads the XML-serialized object from a stream- Parameters:
stream
- the stream to deserialize the object from- Returns:
- the deserialized object
- Throws:
Exception
- if something goes wrong while reading from the stream
-
write
writes the XML-serialized object to the given file- Parameters:
filename
- the file to serialize the object too
- the object to write to the file- Returns:
- whether writing was successful or not
- Throws:
Exception
- if something goes wrong while writing to the file
-
write
write the XML-serialized object to the given file- Parameters:
file
- the file to serialize the object too
- the object to write to the file- Returns:
- whether writing was successful or not
- Throws:
Exception
- if something goes wrong while writing to the file
-
write
writes the XML-serialized object to a stream- Parameters:
stream
- the stream to serialize the object too
- the object to write to the stream- Returns:
- whether writing was successful or not
- Throws:
Exception
- if something goes wrong while writing to the stream
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-