Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jgrapht.ext
Class GmlExporter<V,E>

    java.lang.Object
      org.jgrapht.ext.GmlExporter<V,E>

    public class GmlExporter<V,E>

extends java.lang.Object

Exports a graph into a GML file (Graph Modelling Language).

For a description of the format see http://www.infosun.fmi.uni-passau.de/Graphlet/GML/.

The objects associated with vertices and edges are exported as labels using their toString() implementation. See the `setPrintLabels(Integer)` method. The default behavior is to export no label information.

Author:
  Dimitrios Michail

Field Summary
`static java.lang.Integer` | `PRINT_EDGE_LABELS` Option to export only the edge labels.
`static java.lang.Integer` | `PRINT_EDGE_VERTEX_LABELS` Option to export both edge and vertex labels.
`static java.lang.Integer` | `PRINT_NO_LABELS` Option to export no vertex or edge labels.
`static java.lang.Integer` | `PRINT_VERTEX_LABELS` Option to export only the vertex labels.

Constructor Summary
`GmlExporter()` Creates a new GmlExporter object.

Method Summary
`void` | `export(java.io.Writer output, DirectedGraph<V,E> g)` Exports a directed graph into a plain text file in GML format.
`void` | `export(java.io.Writer output, UndirectedGraph<V,E> g)` Exports an undirected graph into a plain text file in GML format.
`java.lang.Integer` | `getPrintLabels()` Get whether to export the vertex and edge labels.
`void` | `setPrintLabels(java.lang.Integer i)` Set whether to export the vertex and edge labels.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PRINT_NO_LABELS

    public static final java.lang.Integer PRINT_NO_LABELS

  Option to export no vertex or edge labels.

### PRINT_EDGE_LABELS

    public static final java.lang.Integer PRINT_EDGE_LABELS

  Option to export only the edge labels.

### PRINT_EDGE_VERTEX_LABELS

    public static final java.lang.Integer PRINT_EDGE_VERTEX_LABELS

  Option to export both edge and vertex labels.

### PRINT_VERTEX_LABELS

    public static final java.lang.Integer PRINT_VERTEX_LABELS

  Option to export only the vertex labels.

Constructor Detail

### GmlExporter

    public GmlExporter()

  Creates a new GmlExporter object.

Method Detail

### export

    public void export(java.io.Writer output,
                       UndirectedGraph<V,E> g)

  Exports an undirected graph into a plain text file in GML format.

  Parameters:
    `output` - the writer to which the graph to be exported
    `g` - the undirected graph to be exported

### export

    public void export(java.io.Writer output,
                       DirectedGraph<V,E> g)

  Exports a directed graph into a plain text file in GML format.

  Parameters:
    `output` - the writer to which the graph to be exported
    `g` - the directed graph to be exported

### setPrintLabels

    public void setPrintLabels(java.lang.Integer i)

  Set whether to export the vertex and edge labels. The default behavior is to export no vertex or edge labels.

  Parameters:
    `i` - What labels to export. Valid options are `PRINT_NO_LABELS`, `PRINT_EDGE_LABELS`, `PRINT_EDGE_VERTEX_LABELS`, and `PRINT_VERTEX_LABELS`.
  Throws:
    `java.lang.IllegalArgumentException` - if a non-supported value is used
  See Also:
    `PRINT_NO_LABELS`, `PRINT_EDGE_LABELS`, `PRINT_EDGE_VERTEX_LABELS`, `PRINT_VERTEX_LABELS`

### getPrintLabels

    public java.lang.Integer getPrintLabels()

  Get whether to export the vertex and edge labels.

  Returns:
    One of the `PRINT_NO_LABELS`, `PRINT_EDGE_LABELS`, `PRINT_EDGE_VERTEX_LABELS`, or `PRINT_VERTEX_LABELS`.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD