public class PajekNetWriter<V,E> extends Object
Labels for vertices, edge weights, and vertex locations may each optionally be specified. Note that vertex location coordinates must be normalized to the interval [0, 1] on each axis in order to conform to the Pajek specification.
Constructor and Description |
---|
PajekNetWriter()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
save(Graph<V,E> g,
String filename)
Saves the graph to the specified file.
|
void |
save(Graph<V,E> g,
String filename,
com.google.common.base.Function<V,String> vs,
com.google.common.base.Function<E,Number> nev)
Saves the graph to the specified file.
|
void |
save(Graph<V,E> g,
String filename,
com.google.common.base.Function<V,String> vs,
com.google.common.base.Function<E,Number> nev,
com.google.common.base.Function<V,Point2D> vld)
Saves the graph to the specified file.
|
void |
save(Graph<V,E> g,
Writer w)
Saves the graph to the specified writer.
|
void |
save(Graph<V,E> g,
Writer w,
com.google.common.base.Function<V,String> vs,
com.google.common.base.Function<E,Number> nev)
Saves the graph to the specified writer.
|
void |
save(Graph<V,E> graph,
Writer w,
com.google.common.base.Function<V,String> vs,
com.google.common.base.Function<E,Number> nev,
com.google.common.base.Function<V,Point2D> vld)
Saves the graph to the specified writer.
|
public void save(Graph<V,E> g, String filename, com.google.common.base.Function<V,String> vs, com.google.common.base.Function<E,Number> nev, com.google.common.base.Function<V,Point2D> vld) throws IOException
g
- the graph to be savedfilename
- the filename of the file to write the graph tovs
- mapping from vertices to labelsnev
- mapping from edges to weightsvld
- mapping from vertices to locationsIOException
- if the graph cannot be savedpublic void save(Graph<V,E> g, String filename, com.google.common.base.Function<V,String> vs, com.google.common.base.Function<E,Number> nev) throws IOException
g
- the graph to be savedfilename
- the filename of the file to write the graph tovs
- mapping from vertices to labelsnev
- mapping from edges to weightsIOException
- if the graph cannot be savedpublic void save(Graph<V,E> g, String filename) throws IOException
g
- the graph to be savedfilename
- the filename of the file to write the graph toIOException
- if the graph cannot be savedpublic void save(Graph<V,E> g, Writer w) throws IOException
g
- the graph to be savedw
- the writer instance to write the graph toIOException
- if the graph cannot be savedpublic void save(Graph<V,E> g, Writer w, com.google.common.base.Function<V,String> vs, com.google.common.base.Function<E,Number> nev) throws IOException
g
- the graph to be savedw
- the writer instance to write the graph tovs
- mapping from vertices to labelsnev
- mapping from edges to weightsIOException
- if the graph cannot be savedpublic void save(Graph<V,E> graph, Writer w, com.google.common.base.Function<V,String> vs, com.google.common.base.Function<E,Number> nev, com.google.common.base.Function<V,Point2D> vld) throws IOException
graph
- the graph to be savedw
- the writer instance to write the graph tovs
- mapping from vertices to labels (no labels are written if null)nev
- mapping from edges to weights (defaults to weights of 1.0 if null)vld
- mapping from vertices to locations (no locations are written if null)IOException
- if the graph cannot be savedCopyright © 2015. All rights reserved.