- java.lang.Object
-
- org.jgrapht.nio.BaseExporter<V,E>
-
- Type Parameters:
V
- the graph vertex typeE
- 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 Summary
Fields Modifier and Type Field Description protected Optional<Function<E,Map<String,Attribute>>>
edgeAttributeProvider
An edge attribute providerprotected Optional<Function<E,String>>
edgeIdProvider
An edge id providerprotected Optional<Supplier<Map<String,Attribute>>>
graphAttributeProvider
A graph attribute providerprotected Optional<Supplier<String>>
graphIdProvider
A graph id providerprotected Optional<Function<V,Map<String,Attribute>>>
vertexAttributeProvider
A vertex attribute providerprotected Function<V,String>
vertexIdProvider
A vertex id provider
-
Constructor Summary
Constructors Constructor Description BaseExporter(Function<V,String> vertexIdProvider)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Optional<Attribute>
getEdgeAttribute(E e, String key)
Get an optional of an edge attributeOptional<Function<E,Map<String,Attribute>>>
getEdgeAttributeProvider()
Get the edge attribute providerprotected Optional<Map<String,Attribute>>
getEdgeAttributes(E e)
Get edge attributesprotected Optional<String>
getEdgeId(E e)
Get an optional of the edge idOptional<Function<E,String>>
getEdgeIdProvider()
Get the edge id providerprotected Optional<Attribute>
getGraphAttribute(String key)
Get an optional of a graph attributeOptional<Supplier<Map<String,Attribute>>>
getGraphAttributeProvider()
Get the graph attribute provider.protected Optional<String>
getGraphId()
Get the graph id if presentOptional<Supplier<String>>
getGraphIdProvider()
Get the graph id provider.protected Optional<Attribute>
getVertexAttribute(V v, String key)
Get an optional of a vertex attributeOptional<Function<V,Map<String,Attribute>>>
getVertexAttributeProvider()
Get the vertex attribute providerprotected Optional<Map<String,Attribute>>
getVertexAttributes(V v)
Get vertex attributesprotected String
getVertexId(V v)
Get the vertex idFunction<V,String>
getVertexIdProvider()
Get vertex id provider.void
setEdgeAttributeProvider(Function<E,Map<String,Attribute>> edgeAttributeProvider)
Set the edge attribute provider.void
setEdgeIdProvider(Function<E,String> edgeIdProvider)
Set edge id providervoid
setGraphAttributeProvider(Supplier<Map<String,Attribute>> graphAttributeProvider)
Set the graph attribute provider.void
setGraphIdProvider(Supplier<String> graphIdProvider)
Set the graph id provider.void
setVertexAttributeProvider(Function<V,Map<String,Attribute>> vertexAttributeProvider)
Set the vertex attribute providervoid
setVertexIdProvider(Function<V,String> vertexIdProvider)
Set the vertex id provider
-
-
-
Method Detail
-
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 vkey
- 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 ekey
- the attribute key- Returns:
- the attribute as an
Optional
-
-