public final class GraphMl extends Object
Modifier | Constructor and Description |
---|---|
private |
GraphMl()
hidden constructor for static class.
|
Modifier and Type | Method and Description |
---|---|
private static void |
addEdge(Edge edge,
org.jdom2.Element element)
Add an edge to the graphML document.
|
private static void |
addNode(Vertex vertex,
org.jdom2.Element element)
Add a node to the graphML document.
|
static void |
save(String file,
Graph<? extends Vertex,? extends Edge<Vertex>> network)
Save the graph as in graphML format in the given file.
|
static String |
toString(Graph<? extends Vertex,? extends Edge<?>> network)
Get the string representation of the network.
|
static String |
toString(Graph<? extends Vertex,? extends Edge<?>> network,
boolean directed)
Get the string representation of the network.
|
public static String toString(Graph<? extends Vertex,? extends Edge<?>> network, boolean directed)
network
- the network object to be written.directed
- a boolean flag, true if the network is directed.public static String toString(Graph<? extends Vertex,? extends Edge<?>> network)
network
- the network object to be written.public static void save(String file, Graph<? extends Vertex,? extends Edge<Vertex>> network)
network
- the network object to be saved.file
- the name of the file in which the graph will be saved.private static void addEdge(Edge edge, org.jdom2.Element element)
edge
- the edge to be added to the graph element.element
- the graph element of the graphML documentprivate static void addNode(Vertex vertex, org.jdom2.Element element)
vertex
- the id of the node.element
- the graph element of the graphML document.Copyright © 2015 University of Glasgow. All rights reserved.