org.grinvin.io

Class GraphSaver


public class GraphSaver
extends java.lang.Object

Saves a GraphView as a graph.xml-section onto an output stream.

Constructor Summary

GraphSaver(GraphView graph)
Creates a new instance of this saver for the given abstract graph.

Method Summary

Map
getVertexMap()
Return the vertex map for this graph.
void
save(OutputStream out)
Save the graph onto the output stream.
Element
toElement()
Create a JDOM-element that represents the abstract graph for this initializer.

Constructor Details

GraphSaver

public GraphSaver(GraphView graph)
Creates a new instance of this saver for the given abstract graph. Initializes the vertex map.

Method Details

getVertexMap

public Map getVertexMap()
Return the vertex map for this graph. This map can be used by other savers to translate actual vertex objects to vertex numbers.

save

public void save(OutputStream out)
            throws IOException
Save the graph onto the output stream.
Parameters:
out - Output stream to which the result shall be written.

toElement

public Element toElement()
Create a JDOM-element that represents the abstract graph for this initializer.