public class GMLWriter extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
outputGraph(Graph graph,
OutputStream graphMLOutputStream)
Write the data in a Graph to a GML OutputStream.
|
static void |
outputGraph(Graph graph,
String filename)
Write the data in a Graph to a GML OutputStream.
|
void |
outputGraph(OutputStream gMLOutputStream)
Write the data in a Graph to a GML OutputStream.
|
void |
outputGraph(String filename)
Write the data in a Graph to a GML OutputStream.
|
void |
setEdgeIdKey(String edgeIdKey) |
void |
setNormalize(boolean normalize) |
void |
setStrict(boolean strict) |
void |
setUseId(boolean useId) |
void |
setVertexIdKey(String vertexIdKey) |
public GMLWriter(Graph graph)
graph - the Graph to pull the data frompublic void setStrict(boolean strict)
strict - when set to true, property keys in the graph that do not meet the exact guidelines of the GML
specification are ignored. By default this value is false.public void setNormalize(boolean normalize)
normalize - whether to normalize the output. Normalized output is deterministic with respect to the order of
elements and properties in the resulting XML document, and is compatible with line diff-based tools
such as Git. Note: normalized output is memory-intensive and is not appropriate for very large graphs.public void setUseId(boolean useId)
useId - whether to use the blueprints id directly or substitute with a generated integer. To use this option
the blueprints ids must all be Integers of String representations of integerspublic void setVertexIdKey(String vertexIdKey)
vertexIdKey - gml property to use for the blueprints vertex id, defaults to GMLTokens.BLUEPRINTS_IDpublic void setEdgeIdKey(String edgeIdKey)
edgeIdKey - gml property to use for the blueprints edges id, defaults to GMLTokens.BLUEPRINTS_IDpublic void outputGraph(String filename) throws IOException
filename - the GML file to write the Graph data toIOException - thrown if there is an error generating the GML datapublic void outputGraph(OutputStream gMLOutputStream) throws IOException
gMLOutputStream - the GML OutputStream to write the Graph data toIOException - thrown if there is an error generating the GML datapublic static void outputGraph(Graph graph, OutputStream graphMLOutputStream) throws IOException
graph - the Graph to pull the data fromgraphMLOutputStream - the GML OutputStream to write the Graph data toIOException - thrown if there is an error generating the GML datapublic static void outputGraph(Graph graph, String filename) throws IOException
graph - the Graph to pull the data fromfilename - the GML file to write the Graph data toIOException - thrown if there is an error generating the GML dataCopyright © 2010-2014. All Rights Reserved.