Package edu.uci.ics.jung.io
Class PajekNetWriter<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.io.PajekNetWriter<V,E>
-
public class PajekNetWriter<V,E> extends java.lang.Object
Writes graphs in the Pajek NET format.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 Summary
Constructors Constructor Description PajekNetWriter()
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
save(Graph<V,E> g, java.io.Writer w)
Saves the graph to the specified writer.void
save(Graph<V,E> g, java.io.Writer w, com.google.common.base.Function<V,java.lang.String> vs, com.google.common.base.Function<E,java.lang.Number> nev)
Saves the graph to the specified writer.void
save(Graph<V,E> graph, java.io.Writer w, com.google.common.base.Function<V,java.lang.String> vs, com.google.common.base.Function<E,java.lang.Number> nev, com.google.common.base.Function<V,java.awt.geom.Point2D> vld)
Saves the graph to the specified writer.void
save(Graph<V,E> g, java.lang.String filename)
Saves the graph to the specified file.void
save(Graph<V,E> g, java.lang.String filename, com.google.common.base.Function<V,java.lang.String> vs, com.google.common.base.Function<E,java.lang.Number> nev)
Saves the graph to the specified file.void
save(Graph<V,E> g, java.lang.String filename, com.google.common.base.Function<V,java.lang.String> vs, com.google.common.base.Function<E,java.lang.Number> nev, com.google.common.base.Function<V,java.awt.geom.Point2D> vld)
Saves the graph to the specified file.
-
-
-
Method Detail
-
save
public void save(Graph<V,E> g, java.lang.String filename, com.google.common.base.Function<V,java.lang.String> vs, com.google.common.base.Function<E,java.lang.Number> nev, com.google.common.base.Function<V,java.awt.geom.Point2D> vld) throws java.io.IOException
Saves the graph to the specified file.- Parameters:
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 locations- Throws:
java.io.IOException
- if the graph cannot be saved
-
save
public void save(Graph<V,E> g, java.lang.String filename, com.google.common.base.Function<V,java.lang.String> vs, com.google.common.base.Function<E,java.lang.Number> nev) throws java.io.IOException
Saves the graph to the specified file.- Parameters:
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 weights- Throws:
java.io.IOException
- if the graph cannot be saved
-
save
public void save(Graph<V,E> g, java.lang.String filename) throws java.io.IOException
Saves the graph to the specified file. No vertex labels are written, and the edge weights are written as 1.0.- Parameters:
g
- the graph to be savedfilename
- the filename of the file to write the graph to- Throws:
java.io.IOException
- if the graph cannot be saved
-
save
public void save(Graph<V,E> g, java.io.Writer w) throws java.io.IOException
Saves the graph to the specified writer. No vertex labels are written, and the edge weights are written as 1.0.- Parameters:
g
- the graph to be savedw
- the writer instance to write the graph to- Throws:
java.io.IOException
- if the graph cannot be saved
-
save
public void save(Graph<V,E> g, java.io.Writer w, com.google.common.base.Function<V,java.lang.String> vs, com.google.common.base.Function<E,java.lang.Number> nev) throws java.io.IOException
Saves the graph to the specified writer.- Parameters:
g
- the graph to be savedw
- the writer instance to write the graph tovs
- mapping from vertices to labelsnev
- mapping from edges to weights- Throws:
java.io.IOException
- if the graph cannot be saved
-
save
public void save(Graph<V,E> graph, java.io.Writer w, com.google.common.base.Function<V,java.lang.String> vs, com.google.common.base.Function<E,java.lang.Number> nev, com.google.common.base.Function<V,java.awt.geom.Point2D> vld) throws java.io.IOException
Saves the graph to the specified writer.- Parameters:
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)- Throws:
java.io.IOException
- if the graph cannot be saved
-
-