Package org.graffiti.plugin.io
Class AbstractIOSerializer
java.lang.Object
org.graffiti.plugin.io.AbstractIOSerializer
- All Implemented Interfaces:
InputSerializer,OutputSerializer,Serializer
public abstract class AbstractIOSerializer extends Object implements InputSerializer, OutputSerializer
Provides additional methods to read and write from/to different kinds of
targets.
- Version:
- $Revision: 1.4 $
-
Constructor Summary
Constructors Constructor Description AbstractIOSerializer() -
Method Summary
Modifier and Type Method Description Graphread(InputStream in)Reads in a graph from the given input stream.abstract voidread(InputStream in, Graph g)Reads in a graph from the given input stream.voidread(String filename, Graph g)Reads in a graph from the given filename.voidread(URL url, Graph g)Reads in the graph from the given url.voidwrite(String filename, Graph g)Writes the contents of the given graph to a file.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graffiti.plugin.io.InputSerializer
read, validForMethods inherited from interface org.graffiti.plugin.io.OutputSerializer
validFor, writeMethods inherited from interface org.graffiti.plugin.io.Serializer
getExtensions, getFileTypeDescriptions
-
Constructor Details
-
AbstractIOSerializer
public AbstractIOSerializer()
-
-
Method Details
-
read
Reads in a graph from the given filename.- Specified by:
readin interfaceInputSerializer- Parameters:
filename- The name of the file to read the graph from.g- The graph to add the newly read graph to.- Throws:
IOException- If an IO error occurs.
-
read
Reads in the graph from the given url.- Specified by:
readin interfaceInputSerializer- Parameters:
url- The URL to read the graph from.g- The graph to add the newly read graph to.- Throws:
IOException- If an IO error occurs.
-
read
Reads in a graph from the given input stream.- Specified by:
readin interfaceInputSerializer- Parameters:
in- The input stream to read the graph from.g- The graph to add the newly read graph to.- Throws:
IOException- If an IO error occurs.
-
read
Reads in a graph from the given input stream.- Specified by:
readin interfaceInputSerializer- Parameters:
in- The input stream to read the graph from.- Returns:
- The newly read graph.
- Throws:
IOException- If an IO error occurs.
-
write
Writes the contents of the given graph to a file.- Parameters:
filename- The name of the file to save the graph to.g- The graph to save.- Throws:
IOException- If an IO error occurs.
-