N
- node value typeE
- edge value typepublic final class XgmmlGraphWriter<N,E> extends Object implements GraphWriter<N,E>
Modifier and Type | Class and Description |
---|---|
static interface |
XgmmlGraphWriter.ValueHandler<V>
Value handler.
|
Constructor and Description |
---|
XgmmlGraphWriter()
Create a new XGMML graph writer.
|
Modifier and Type | Method and Description |
---|---|
void |
addEdgeValueHandler(String name,
XgmmlGraphWriter.ValueHandler<E> edgeValueHandler)
Add the specified edge value handler for the specified attribute name.
|
void |
addNodeValueHandler(String name,
XgmmlGraphWriter.ValueHandler<N> nodeValueHandler)
Add the specified node value handler for the specified attribute name.
|
void |
write(Graph<N,E> graph,
File file)
Write the specified graph to the specified file.
|
void |
write(Graph<N,E> graph,
OutputStream outputStream)
Write the specified graph to the specified output stream.
|
public void addNodeValueHandler(String name, XgmmlGraphWriter.ValueHandler<N> nodeValueHandler)
name
- attribute name, must not be nullnodeValueHandler
- node value handler to add, must not be nullpublic void addEdgeValueHandler(String name, XgmmlGraphWriter.ValueHandler<E> edgeValueHandler)
name
- attribute name, must not be nulledgeValueHandler
- edge value handler to add, must not be nullpublic void write(Graph<N,E> graph, File file) throws IOException
write
in interface GraphWriter<N,E>
graph
- graph to write, must not be nullfile
- file to write to, must not be nullIOException
- if an IO error occurspublic void write(Graph<N,E> graph, OutputStream outputStream) throws IOException
write
in interface GraphWriter<N,E>
graph
- graph to write, must not be nulloutputStream
- output stream to write to, must not be nullIOException
- if an IO error occursCopyright (c) 2008-2013 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).