Search this API

y.io
Interface YGFIOHandler.DataHandler

Enclosing class:
YGFIOHandler

public static interface YGFIOHandler.DataHandler

Implementations of this interface can be added to this IOHandler in order to read and write additional data for graphs, nodes and edges.

See Also:
YGFIOHandler.addDataHandler(String,y.io.YGFIOHandler.DataHandler), YGFIOHandler.getDataHandler(String), YGFIOHandler.removeDataHandler(String)
 

Method Summary
 void readData(Graph2D graph, java.lang.Object obj, java.io.ObjectInputStream in)
          This method reads data from the given input stream and processes it.
 void writeData(Graph2D graph, java.lang.Object obj, java.io.ObjectOutputStream out)
          This method writes data to the given input stream.
 

Method Detail

readData

void readData(Graph2D graph,
              java.lang.Object obj,
              java.io.ObjectInputStream in)
              throws java.io.IOException
This method reads data from the given input stream and processes it. The method is being called for each Node, Edge or Graph2D that is contained in the actual input graph.

Parameters:
graph - the graph for which to read data.
obj - a Node, an Edge or the graph itself. This object is directly associated with the actual data.
in - the input stream from which to read data.
Throws:
java.io.IOException - thrown if something does wrong while reading data.

writeData

void writeData(Graph2D graph,
               java.lang.Object obj,
               java.io.ObjectOutputStream out)
               throws java.io.IOException
This method writes data to the given input stream. The method is being called for each Node, Edge or Graph2D that is contained in the actual input graph.

Parameters:
graph - the graph for which to write data.
obj - a Node, an Edge or the graph itself. This object is directly associated with the actual data.
out - the output stream from which to write data.
Throws:
java.io.IOException - thrown if something does wrong while writing data.

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.