Class PajekNetWriter<V,​E>


  • public class PajekNetWriter<V,​E>
    extends java.lang.Object
    Writes graphs in the Pajek NET format.

    Labels for vertices may optionally be specified by implementations of VertexStringer. Edge weights are optionally specified by implementations of Transformer. Vertex locations are optionally specified by implementations of Transformer. 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​(edu.uci.ics.jung.graph.Graph<V,​E> g, java.io.Writer w)
      Saves g to w; no vertex labels are written out, and the edge weights are written as 1.0.
      void save​(edu.uci.ics.jung.graph.Graph<V,​E> g, java.io.Writer w, org.apache.commons.collections4.Transformer<V,​java.lang.String> vs, org.apache.commons.collections4.Transformer<E,​java.lang.Number> nev)
      Saves g to w; vertex labels are given by vs and edge weights by nev.
      void save​(edu.uci.ics.jung.graph.Graph<V,​E> graph, java.io.Writer w, org.apache.commons.collections4.Transformer<V,​java.lang.String> vs, org.apache.commons.collections4.Transformer<E,​java.lang.Number> nev, org.apache.commons.collections4.Transformer<V,​java.awt.geom.Point2D> vld)
      Writes graph to w.
      void save​(edu.uci.ics.jung.graph.Graph<V,​E> g, java.lang.String filename)
      Saves g to filename; no vertex labels are written out, and the edge weights are written as 1.0.
      void save​(edu.uci.ics.jung.graph.Graph<V,​E> g, java.lang.String filename, org.apache.commons.collections4.Transformer<V,​java.lang.String> vs, org.apache.commons.collections4.Transformer<E,​java.lang.Number> nev)
      Saves g to filename.
      void save​(edu.uci.ics.jung.graph.Graph<V,​E> g, java.lang.String filename, org.apache.commons.collections4.Transformer<V,​java.lang.String> vs, org.apache.commons.collections4.Transformer<E,​java.lang.Number> nev, org.apache.commons.collections4.Transformer<V,​java.awt.geom.Point2D> vld)
      Saves g to filename.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PajekNetWriter

        public PajekNetWriter()
        Creates a new instance.
    • Method Detail

      • save

        public void save​(edu.uci.ics.jung.graph.Graph<V,​E> g,
                         java.lang.String filename,
                         org.apache.commons.collections4.Transformer<V,​java.lang.String> vs,
                         org.apache.commons.collections4.Transformer<E,​java.lang.Number> nev,
                         org.apache.commons.collections4.Transformer<V,​java.awt.geom.Point2D> vld)
                  throws java.io.IOException
        Saves g to filename. Labels for vertices may be supplied by vs. Edge weights are specified by nev.
        Throws:
        java.io.IOException
      • save

        public void save​(edu.uci.ics.jung.graph.Graph<V,​E> g,
                         java.lang.String filename,
                         org.apache.commons.collections4.Transformer<V,​java.lang.String> vs,
                         org.apache.commons.collections4.Transformer<E,​java.lang.Number> nev)
                  throws java.io.IOException
        Saves g to filename. Labels are specified by vs, and edge weights by nev; vertex coordinates are not written out.
        Parameters:
        g - the graph to write out
        filename -
        vs -
        nev -
        Throws:
        java.io.IOException
      • save

        public void save​(edu.uci.ics.jung.graph.Graph<V,​E> g,
                         java.lang.String filename)
                  throws java.io.IOException
        Saves g to filename; no vertex labels are written out, and the edge weights are written as 1.0.
        Throws:
        java.io.IOException
      • save

        public void save​(edu.uci.ics.jung.graph.Graph<V,​E> g,
                         java.io.Writer w)
                  throws java.io.IOException
        Saves g to w; no vertex labels are written out, and the edge weights are written as 1.0.
        Throws:
        java.io.IOException
      • save

        public void save​(edu.uci.ics.jung.graph.Graph<V,​E> g,
                         java.io.Writer w,
                         org.apache.commons.collections4.Transformer<V,​java.lang.String> vs,
                         org.apache.commons.collections4.Transformer<E,​java.lang.Number> nev)
                  throws java.io.IOException
        Saves g to w; vertex labels are given by vs and edge weights by nev.
        Parameters:
        g -
        w -
        vs -
        nev -
        Throws:
        java.io.IOException
      • save

        public void save​(edu.uci.ics.jung.graph.Graph<V,​E> graph,
                         java.io.Writer w,
                         org.apache.commons.collections4.Transformer<V,​java.lang.String> vs,
                         org.apache.commons.collections4.Transformer<E,​java.lang.Number> nev,
                         org.apache.commons.collections4.Transformer<V,​java.awt.geom.Point2D> vld)
                  throws java.io.IOException
        Writes graph to w. Labels for vertices may be supplied by vs (defaults to no labels if null), edge weights may be specified by nev (defaults to weights of 1.0 if null), and vertex locations may be specified by vld (defaults to no locations if null).
        Throws:
        java.io.IOException