Class BaseExporter<V,E>

java.lang.Object
org.jgrapht.nio.BaseExporter<V,E>
Type Parameters:
V - the graph vertex type
E - the graph edge type
Direct Known Subclasses:
CSVExporter, DIMACSExporter, DOTExporter, GEXFExporter, GmlExporter, GraphMLExporter, JSONExporter, LemonExporter, MatrixExporter, VisioExporter

public abstract class BaseExporter<V,E> extends Object
Base implementation for an exporter.
Author:
Dimitrios Michail
  • Field Details

  • Constructor Details

    • BaseExporter

      public BaseExporter(Function<V,String> vertexIdProvider)
      Constructor
      Parameters:
      vertexIdProvider - the vertex id provider to use. Cannot be null.
  • Method Details

    • getGraphIdProvider

      public Optional<Supplier<String>> getGraphIdProvider()
      Get the graph id provider.
      Returns:
      the graph id provider as an Optional.
    • setGraphIdProvider

      public void setGraphIdProvider(Supplier<String> graphIdProvider)
      Set the graph id provider.
      Parameters:
      graphIdProvider - the graph id provider
    • getGraphAttributeProvider

      public Optional<Supplier<Map<String,Attribute>>> getGraphAttributeProvider()
      Get the graph attribute provider.
      Returns:
      the graph attribute provider as an Optional.
    • setGraphAttributeProvider

      public void setGraphAttributeProvider(Supplier<Map<String,Attribute>> graphAttributeProvider)
      Set the graph attribute provider.
      Parameters:
      graphAttributeProvider - the graph attribute provider
    • getVertexIdProvider

      public Function<V,String> getVertexIdProvider()
      Get vertex id provider.
      Returns:
      the vertex id provider
    • setVertexIdProvider

      public void setVertexIdProvider(Function<V,String> vertexIdProvider)
      Set the vertex id provider
      Parameters:
      vertexIdProvider - the vertex id provider
    • getVertexAttributeProvider

      public Optional<Function<V,Map<String,Attribute>>> getVertexAttributeProvider()
      Get the vertex attribute provider
      Returns:
      the vertex attribute provider as an Optional
    • setVertexAttributeProvider

      public void setVertexAttributeProvider(Function<V,Map<String,Attribute>> vertexAttributeProvider)
      Set the vertex attribute provider
      Parameters:
      vertexAttributeProvider - the vertex attribute provider
    • getEdgeIdProvider

      public Optional<Function<E,String>> getEdgeIdProvider()
      Get the edge id provider
      Returns:
      the edge id provider as an Optional.
    • setEdgeIdProvider

      public void setEdgeIdProvider(Function<E,String> edgeIdProvider)
      Set edge id provider
      Parameters:
      edgeIdProvider - the edge id provider
    • getEdgeAttributeProvider

      public Optional<Function<E,Map<String,Attribute>>> getEdgeAttributeProvider()
      Get the edge attribute provider
      Returns:
      the edge attribute provider as an Optional
    • setEdgeAttributeProvider

      public void setEdgeAttributeProvider(Function<E,Map<String,Attribute>> edgeAttributeProvider)
      Set the edge attribute provider.
      Parameters:
      edgeAttributeProvider - the edge attribute provider
    • getGraphId

      protected Optional<String> getGraphId()
      Get the graph id if present
      Returns:
      an Optional of the graph id
    • getVertexId

      protected String getVertexId(V v)
      Get the vertex id
      Parameters:
      v - the vertex
      Returns:
      the id of the vertex
    • getEdgeId

      protected Optional<String> getEdgeId(E e)
      Get an optional of the edge id
      Parameters:
      e - the edge
      Returns:
      the edge id
    • getVertexAttributes

      protected Optional<Map<String,Attribute>> getVertexAttributes(V v)
      Get vertex attributes
      Parameters:
      v - the vertex v
      Returns:
      the vertex attributes as an Optional
    • getVertexAttribute

      protected Optional<Attribute> getVertexAttribute(V v, String key)
      Get an optional of a vertex attribute
      Parameters:
      v - the vertex v
      key - the attribute key
      Returns:
      the attribute as an Optional
    • getEdgeAttributes

      protected Optional<Map<String,Attribute>> getEdgeAttributes(E e)
      Get edge attributes
      Parameters:
      e - the edge e
      Returns:
      the edge attributes as an Optional
    • getEdgeAttribute

      protected Optional<Attribute> getEdgeAttribute(E e, String key)
      Get an optional of an edge attribute
      Parameters:
      e - the edge e
      key - the attribute key
      Returns:
      the attribute as an Optional
    • getGraphAttribute

      protected Optional<Attribute> getGraphAttribute(String key)
      Get an optional of a graph attribute
      Parameters:
      key - the attribute key
      Returns:
      the attribute as an Optional