public class Graph6TopologySerializer extends Object implements TopologySerializer
Only Graph6 and Digraph6 format are supported. Sparse6 format is not yet implemented.
Modifier and Type | Field and Description |
---|---|
static String[] |
GRAPH6_FILENAME_EXTENSIONS
Supported filename extensions.
|
Constructor and Description |
---|
Graph6TopologySerializer() |
Modifier and Type | Method and Description |
---|---|
String |
exportToString(Topology topology)
Encode the graph of
topology in Graph6 or Digraph6 file format
according to Topology.isDirected() . |
boolean |
generatesHeaders() |
void |
importFromString(Topology topology,
String data)
Populate
topology with the graph described in data . |
void |
setGenerateHeaders(boolean generateHeaders) |
public static final String[] GRAPH6_FILENAME_EXTENSIONS
TopologySerializerFilenameMatcher
.public String exportToString(Topology topology)
topology
in Graph6 or Digraph6 file format
according to Topology.isDirected()
.exportToString
in interface TopologySerializer
topology
- The Topology
object which must be exportedpublic void importFromString(Topology topology, String data)
topology
with the graph described in data
.
The orientation of topology
might be adjusted wrt to the
orientation of the graph in data
.importFromString
in interface TopologySerializer
topology
- The Topology
object which must be populateddata
- The String
representation.public boolean generatesHeaders()
public void setGenerateHeaders(boolean generateHeaders)
generateHeaders
- is true if this serializer has to generate Graph6
headers.