|
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 java.io.ObjectInputStream |
createObjectInputStream(java.lang.String name)
Creates and returns an object input stream that is connected to a file. |
static java.io.ObjectOutputStream |
createObjectOutputStream(java.lang.String name)
Creates and returns an object output stream that is connected to a file. |
abstract java.lang.String |
getFileFormatString()
Returns a descriptive string of the supported file format. |
abstract java.lang.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,
java.io.InputStream in)
Adds the contents that are read from the stream to the given graph. |
void |
read(Graph2D graph,
java.lang.String name)
Fills the contents of the given graph from a file. |
void |
read(Graph2D graph,
java.net.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,
java.io.OutputStream out)
Writes the contents of the given graph to a stream |
void |
write(Graph2D graph,
java.lang.String name)
Writes the contents of the given graph to a file. |
void |
writeSubset(Graph2D graph,
DataProvider dp,
java.io.OutputStream out)
Writes a subset of the contents of the given graph to a stream |
void |
writeSubset(Graph2D graph,
DataProvider dp,
java.lang.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, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public void writeSubset(Graph2D graph, DataProvider dp, java.io.OutputStream out) throws java.io.IOException
graph
- 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
java.io.IOException
public abstract void read(Graph2D graph, java.io.InputStream in) throws java.io.IOException
java.io.IOException
public abstract java.lang.String getFileFormatString()
public abstract java.lang.String getFileNameExtension()
public void write(Graph2D graph, java.lang.String name) throws java.io.IOException
name
- The name of the output file
java.io.IOException
public void writeSubset(Graph2D graph, DataProvider dp, java.lang.String name) throws java.io.IOException
java.io.IOException
public void read(Graph2D graph, java.lang.String name) throws java.io.IOException
name
- The name of the file to be read.
java.io.IOException
public void read(Graph2D graph, java.net.URL url) throws java.io.IOException
url
- The url of the resource to be read.
java.io.IOException
public static java.io.ObjectInputStream createObjectInputStream(java.lang.String name) throws java.io.IOException
name
- The name of the input file.
java.io.IOException
public static java.io.ObjectOutputStream createObjectOutputStream(java.lang.String name) throws java.io.IOException
name
- The name of the output file.
java.io.IOException
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 notprotected 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 serializedprotected 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-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |