|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.io.IOHandler
public abstract class 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 of the supported file format. |
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 that are read from the 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
IOExceptiongraph - the graph to be written outdp - the data provider, which contains boolean information
for each element, which indicates, whether this item
should be serialized or not
public abstract void read(Graph2D graph,
InputStream in)
throws IOException
IOExceptionpublic abstract String getFileFormatString()
public abstract String getFileNameExtension()
public void write(Graph2D graph,
String name)
throws IOException
IOExceptionname - The name of the output file
public void writeSubset(Graph2D graph,
DataProvider dp,
String name)
throws IOException
IOException
public void read(Graph2D graph,
String name)
throws IOException
IOExceptionname - The name of the file to be read.
public void read(Graph2D graph,
URL url)
throws IOException
IOExceptionurl - The url of the resource to be read.
public static ObjectInputStream createObjectInputStream(String name)
throws IOException
IOExceptionname - The name of the input file.
public static ObjectOutputStream createObjectOutputStream(String name)
throws IOException
IOExceptionname - 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 data provider which tells which graph elements to serialize
and which not
protected boolean shouldSerialize(Node node,
DataProvider dp)
node - the nodedp - the data provider which tells which graph elements to serialize
and which not
true iff this elements should be serialized
protected boolean shouldSerialize(Edge edge,
DataProvider dp)
edge - the edgedp - the data provider which tells which graph elements to serialize
and which not
true iff this elements should be serialized
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||