Search this API

y.io
Class YGFIOHandler

java.lang.Object
  extended by y.io.IOHandler
      extended by y.io.YGFIOHandler

Deprecated. Use the GraphML format instead.

public class YGFIOHandler
extends IOHandler

Reading and Writing graphs in Y Graph Format (YGF).

 

Nested Class Summary
static interface YGFIOHandler.DataHandler
          Deprecated. Implementations of this interface can be added to this IOHandler in order to read and write additional data for graphs, nodes and edges.
 
Field Summary
protected static java.util.Map decode2encodeMap
          Deprecated.  
protected static java.util.Map encode2decodeMap
          Deprecated.  
 
Constructor Summary
YGFIOHandler()
          Deprecated. Instantiates a new YGFIOHandler.
 
Method Summary
 void addDataHandler(java.lang.String key, YGFIOHandler.DataHandler dataHandler)
          Deprecated. Register a DataHandler with this class.
static void addEncoding(java.lang.String encodedName, java.lang.String decodedName)
          Deprecated. Adds a new class name encoding to YGFIOHandler.
protected  Graph2D createInnerGraph(Node anchorNode)
          Deprecated. Creates a new graph instance that is used as inner graph for a Graph2DNodeRealizer in case the read in graph is not part of a graph hierarchy.
protected  java.io.ObjectInputStream createObjectInputStream(java.io.InputStream is)
          Deprecated. Wraps the specified stream in an ObjectInputStream.
protected  java.io.ObjectOutputStream createObjectOutputStream(java.io.OutputStream os)
          Deprecated. Wraps the specified stream in an ObjectOutputStream.
static java.lang.String decode(java.lang.String encodedName)
          Deprecated. Decodes the external class name string generated by encode(String).
static java.lang.String encode(java.lang.String decodedName)
          Deprecated. Returns the external form of a given class name string.
 YGFIOHandler.DataHandler getDataHandler(java.lang.String key)
          Deprecated. Returns the DataHandler registered with the given key.
 java.lang.String getFileFormatString()
          Deprecated. Returns the YGF file format string.
 java.lang.String getFileNameExtension()
          Deprecated. Returns the YGF file name extension, i.e.
 void read(Graph2D graph, java.io.InputStream in)
          Deprecated. Adds the contents that are read from the stream to the given graph.
protected  void read(Graph2D graph, java.io.ObjectInputStream in)
          Deprecated. Fills the contents of the given graph from an ObjectInputStream.
protected  void readEdgeInfo(Graph2D graph, Edge e, java.io.ObjectInputStream in)
          Deprecated. Reads edge information from the given input stream.
protected  void readEdgeRealizer(Graph2D graph, Edge e, java.io.ObjectInputStream in)
          Deprecated. Reads edge realizer information from the input stream.
protected  void readFolderNodeInfo(Graph2D graph, Node v, java.io.ObjectInputStream in)
          Deprecated. Reads in folder node information if the given graph was part of a graph hierarchy.
protected  void readGroupNodeInfo(Graph2D graph, Node v, java.io.ObjectInputStream in)
          Deprecated. Reads in group node information if the given graph was part of a graph hierarchy and contained grouped nodes.
protected  void readInterEdgeInfo(Graph2D graph, Edge e, java.io.ObjectInputStream in)
          Deprecated. Reads graph hierarchic inter-edge information from the given input stream.
protected  void readNodeInfo(Graph2D graph, Node v, java.io.ObjectInputStream in)
          Deprecated. Reads node information from the input stream.
protected  void readNodeRealizer(Graph2D graph, Node v, java.io.ObjectInputStream in)
          Deprecated. Reads node realizer information from the input stream.
 void removeDataHandler(java.lang.String key)
          Deprecated. Removes the DataHandler registered with the given ID.
protected  void write(Graph2D graph, java.io.ObjectOutputStream out)
          Deprecated. Writes the contents of the given graph to an ObjectOutputStream.
 void write(Graph2D graph, java.io.OutputStream out)
          Deprecated. Writes the contents of the given graph in YGF format to a stream.
protected  void writeEdgeInfo(Graph2D graph, Edge e, java.io.ObjectOutputStream out)
          Deprecated. Writes edge information to the output stream.
protected  void writeEdgeRealizer(Graph2D graph, Edge e, java.io.ObjectOutputStream out)
          Deprecated. Writes edge realizer information to the given output stream.
protected  void writeFolderNodeInfo(Graph2D graph, Node v, java.io.ObjectOutputStream out)
          Deprecated. Writes out folder node information if the given graph is part of a graph hierarchy.
protected  void writeGroupNodeInfo(Graph2D graph, Node v, java.io.ObjectOutputStream out)
          Deprecated. Writes out group node information if the given graph is part of a graph hierarchy.
protected  void writeInterEdgeInfo(Graph2D graph, Edge e, java.io.ObjectOutputStream out)
          Deprecated. Writes graph hierarchic inter-edge information to the given output stream.
protected  void writeNodeInfo(Graph2D graph, Node v, java.io.ObjectOutputStream out)
          Deprecated. Writes node information to the output stream.
protected  void writeNodeRealizer(Graph2D graph, Node v, java.io.ObjectOutputStream out)
          Deprecated. Writes node realizer information to the output stream.
 
Methods inherited from class y.io.IOHandler
canRead, canWrite, canWriteSubset, createObjectInputStream, createObjectOutputStream, hide, read, read, shouldSerialize, shouldSerialize, write, writeSubset, writeSubset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encode2decodeMap

protected static java.util.Map encode2decodeMap
Deprecated. 

decode2encodeMap

protected static java.util.Map decode2encodeMap
Deprecated. 
Constructor Detail

YGFIOHandler

public YGFIOHandler()
Deprecated. 
Instantiates a new YGFIOHandler.

Method Detail

addEncoding

public static void addEncoding(java.lang.String encodedName,
                               java.lang.String decodedName)
Deprecated. 
Adds a new class name encoding to YGFIOHandler. The methods encode(String) and decode(String) can be used to translate between encoded and decoded names.


encode

public static java.lang.String encode(java.lang.String decodedName)
Deprecated. 
Returns the external form of a given class name string. If the given name can't be encoded, the decoded name itself will be returned.


decode

public static java.lang.String decode(java.lang.String encodedName)
Deprecated. 
Decodes the external class name string generated by encode(String). If the given name can't be decoded, the encoded name itself will be returned.


getFileFormatString

public java.lang.String getFileFormatString()
Deprecated. 
Returns the YGF file format string.

Specified by:
getFileFormatString in class IOHandler

getFileNameExtension

public java.lang.String getFileNameExtension()
Deprecated. 
Returns the YGF file name extension, i.e. "ygf"

Specified by:
getFileNameExtension in class IOHandler

write

public void write(Graph2D graph,
                  java.io.OutputStream out)
           throws java.io.IOException
Deprecated. 
Writes the contents of the given graph in YGF format to a stream.

Specified by:
write in class IOHandler
Throws:
java.io.IOException

write

protected void write(Graph2D graph,
                     java.io.ObjectOutputStream out)
              throws java.io.IOException
Deprecated. 
Writes the contents of the given graph to an ObjectOutputStream.

Throws:
java.io.IOException

writeEdgeInfo

protected void writeEdgeInfo(Graph2D graph,
                             Edge e,
                             java.io.ObjectOutputStream out)
                      throws java.io.IOException
Deprecated. 
Writes edge information to the output stream. Edge information includes realizer information and graph hierarchic inter-edge information. Subclasses may want to refine this method.

Parameters:
e - The edge for which information is written out
Throws:
java.io.IOException

writeEdgeRealizer

protected void writeEdgeRealizer(Graph2D graph,
                                 Edge e,
                                 java.io.ObjectOutputStream out)
                          throws java.io.IOException
Deprecated. 
Writes edge realizer information to the given output stream.

Throws:
java.io.IOException

writeInterEdgeInfo

protected void writeInterEdgeInfo(Graph2D graph,
                                  Edge e,
                                  java.io.ObjectOutputStream out)
                           throws java.io.IOException
Deprecated. 
Writes graph hierarchic inter-edge information to the given output stream.

Throws:
java.io.IOException

writeNodeInfo

protected void writeNodeInfo(Graph2D graph,
                             Node v,
                             java.io.ObjectOutputStream out)
                      throws java.io.IOException
Deprecated. 
Writes node information to the output stream. Node information includes realizer information and graph hierarchic inner graph information Subclasses may want to overwrite this method.

Parameters:
v - The node for which information is written out
Throws:
java.io.IOException

writeNodeRealizer

protected void writeNodeRealizer(Graph2D graph,
                                 Node v,
                                 java.io.ObjectOutputStream out)
                          throws java.io.IOException
Deprecated. 
Writes node realizer information to the output stream.

Parameters:
v - The node for which information is written out
Throws:
java.io.IOException

writeFolderNodeInfo

protected void writeFolderNodeInfo(Graph2D graph,
                                   Node v,
                                   java.io.ObjectOutputStream out)
                            throws java.io.IOException
Deprecated. 
Writes out folder node information if the given graph is part of a graph hierarchy.

Throws:
java.io.IOException

writeGroupNodeInfo

protected void writeGroupNodeInfo(Graph2D graph,
                                  Node v,
                                  java.io.ObjectOutputStream out)
                           throws java.io.IOException
Deprecated. 
Writes out group node information if the given graph is part of a graph hierarchy.

Throws:
java.io.IOException

read

public void read(Graph2D graph,
                 java.io.InputStream in)
          throws java.io.IOException
Deprecated. 
Description copied from class: IOHandler
Adds the contents that are read from the stream to the given graph. The given graph will not be cleared when the content of the file will be added to it.

Specified by:
read in class IOHandler
Throws:
java.io.IOException

read

protected void read(Graph2D graph,
                    java.io.ObjectInputStream in)
             throws java.io.IOException
Deprecated. 
Fills the contents of the given graph from an ObjectInputStream.

Throws:
java.io.IOException

readNodeInfo

protected void readNodeInfo(Graph2D graph,
                            Node v,
                            java.io.ObjectInputStream in)
                     throws java.io.IOException
Deprecated. 
Reads node information from the input stream. Subclasses may want to overwrite this method.

Parameters:
v - The node for which information is read in
graph - The graph that is the owner of the given node.
Throws:
java.io.IOException

readNodeRealizer

protected void readNodeRealizer(Graph2D graph,
                                Node v,
                                java.io.ObjectInputStream in)
                         throws java.io.IOException
Deprecated. 
Reads node realizer information from the input stream. Subclasses may want to overwrite this method.

Parameters:
v - The node for which information is read in
graph - The graph that is the owner of the given node.
Throws:
java.io.IOException

createInnerGraph

protected Graph2D createInnerGraph(Node anchorNode)
Deprecated. 
Creates a new graph instance that is used as inner graph for a Graph2DNodeRealizer in case the read in graph is not part of a graph hierarchy.

Parameters:
anchorNode - the anchor node for which to create an inner graph.
Returns:
returns a Graph2D object. Subclasses may want to overwrite this method to return a specialized version of Graph2D.

readFolderNodeInfo

protected void readFolderNodeInfo(Graph2D graph,
                                  Node v,
                                  java.io.ObjectInputStream in)
                           throws java.io.IOException
Deprecated. 
Reads in folder node information if the given graph was part of a graph hierarchy.

Throws:
java.io.IOException

readGroupNodeInfo

protected void readGroupNodeInfo(Graph2D graph,
                                 Node v,
                                 java.io.ObjectInputStream in)
                          throws java.io.IOException
Deprecated. 
Reads in group node information if the given graph was part of a graph hierarchy and contained grouped nodes.

Throws:
java.io.IOException

readEdgeInfo

protected void readEdgeInfo(Graph2D graph,
                            Edge e,
                            java.io.ObjectInputStream in)
                     throws java.io.IOException
Deprecated. 
Reads edge information from the given input stream. Edge information includes realizer information and graph hierarchic inter-edge information. Subclasses may want to refine this method.

Parameters:
e - The edge for which information is read in.
Throws:
java.io.IOException

readEdgeRealizer

protected void readEdgeRealizer(Graph2D graph,
                                Edge e,
                                java.io.ObjectInputStream in)
                         throws java.io.IOException
Deprecated. 
Reads edge realizer information from the input stream.

Parameters:
e - The edge for which information is read in
graph - The graph that is the owner of the given edge
Throws:
java.io.IOException

readInterEdgeInfo

protected void readInterEdgeInfo(Graph2D graph,
                                 Edge e,
                                 java.io.ObjectInputStream in)
                          throws java.io.IOException
Deprecated. 
Reads graph hierarchic inter-edge information from the given input stream.

Throws:
java.io.IOException

addDataHandler

public void addDataHandler(java.lang.String key,
                           YGFIOHandler.DataHandler dataHandler)
Deprecated. 
Register a DataHandler with this class.

Parameters:
key - unique key that identifies the data that is being read and written by the DataHandler. This key is part of the serialized data. the associated data can only be read by DataHandlers that are registered with the same key.

getDataHandler

public YGFIOHandler.DataHandler getDataHandler(java.lang.String key)
Deprecated. 
Returns the DataHandler registered with the given key.

Returns:
either the DataHandler registered with the given key or null if no DataHandler is registered with the given key.

removeDataHandler

public void removeDataHandler(java.lang.String key)
Deprecated. 
Removes the DataHandler registered with the given ID.


createObjectInputStream

protected java.io.ObjectInputStream createObjectInputStream(java.io.InputStream is)
                                                     throws java.io.IOException
Deprecated. 
Wraps the specified stream in an ObjectInputStream. Called from read(y.view.Graph2D, java.io.InputStream).

Parameters:
is - the InputStream to wrap.
Returns:
an ObjectInputStream instance that wraps the given stream.
Throws:
java.io.IOException - if an I/O error occurs when creating the wrapper.

createObjectOutputStream

protected java.io.ObjectOutputStream createObjectOutputStream(java.io.OutputStream os)
                                                       throws java.io.IOException
Deprecated. 
Wraps the specified stream in an ObjectOutputStream. Called from write(y.view.Graph2D, java.io.OutputStream).

Parameters:
os - the OutputStream to wrap.
Returns:
an ObjectOutputStream instance that wraps the given stream.
Throws:
java.io.IOException - if an I/O error occurs when creating the wrapper.

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