|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.io.IOHandler
Abstract IO handler class. An IO handler is responsible for reading and/or writing graphs in a specific format from/to a stream
Constructor Summary | |
IOHandler()
|
Method Summary | |
boolean |
canRead()
Whether this file handler supports reading from a file. |
boolean |
canWrite()
Whether this file handler supports writing to a file. |
boolean |
canWriteSubset()
Whether this file handler supports writing graph subsets to a file. |
static ObjectInputStream |
createObjectInputStream(String name)
Creates and returns an object input stream that is connected to a file. |
static ObjectOutputStream |
createObjectOutputStream(String name)
Creates and returns an object output stream that is connected to a file. |
abstract String |
getFileFormatString()
Returns a descriptive string of the supported file format |
abstract String |
getFileNameExtension()
Returns the file name extension that will be added (if not present) when saving a file. |
protected void |
hide(GraphHider hider,
DataProvider dp)
Uses the GraphHider to hide parts of the graph in order to write a subset. |
abstract void |
read(Graph2D graph,
InputStream in)
Adds the contents reads from a stream to the given graph. |
void |
read(Graph2D graph,
String name)
Fills the contents of the given graph from a file. |
void |
read(Graph2D graph,
URL url)
Fills the contents of the given graph from a URL. |
protected boolean |
shouldSerialize(Edge edge,
DataProvider dp)
Determines whether the given edge should be serialized. |
protected boolean |
shouldSerialize(Node node,
DataProvider dp)
Determines whether the given node should be serialized. |
abstract void |
write(Graph2D graph,
OutputStream out)
Writes the contents of the given graph to a stream |
void |
write(Graph2D graph,
String name)
Writes the contents of the given graph to a file. |
void |
writeSubset(Graph2D graph,
DataProvider dp,
OutputStream out)
Writes a subset of the contents of the given graph to a stream |
void |
writeSubset(Graph2D graph,
DataProvider dp,
String name)
Writes a subset of the contents of the given graph to a stream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IOHandler()
Method Detail |
public abstract void write(Graph2D graph, OutputStream out) throws IOException
IOException
public void writeSubset(Graph2D graph, DataProvider dp, OutputStream out) throws IOException
IOException
graph
- hte graph to be written outdp
- the dataprovider, which contains boolean information
for each element, which indicates, whether this item
should be serialized or notpublic abstract void read(Graph2D graph, InputStream in) throws IOException
IOException
public abstract String getFileFormatString()
public abstract String getFileNameExtension()
public void write(Graph2D graph, String name) throws IOException
IOException
name
- The name of the output filepublic void writeSubset(Graph2D graph, DataProvider dp, String name) throws IOException
IOException
public void read(Graph2D graph, String name) throws IOException
IOException
name
- The name of the file to be read.public void read(Graph2D graph, URL url) throws IOException
IOException
url
- The url of the resource to be read.public static ObjectInputStream createObjectInputStream(String name) throws IOException
IOException
name
- The name of the input file.public static ObjectOutputStream createObjectOutputStream(String name) throws IOException
IOException
name
- The name of the output file.public boolean canRead()
public boolean canWrite()
public boolean canWriteSubset()
protected void hide(GraphHider hider, DataProvider dp)
hider
- the hiderdp
- the dataprovider which tells which graphelements to serialize
and which notprotected boolean shouldSerialize(Node node, DataProvider dp)
node
- the nodedp
- the dataprovider which tells which graphelements to serialize
and which not
true
iff this elements should be serializedprotected boolean shouldSerialize(Edge edge, DataProvider dp)
edge
- the edgedp
- the dataprovider which tells which graphelements to serialize
and which not
true
iff this elements should be serialized
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |