Package science.aist.gtf.graph
Interface Graph<V,E>
-
- Type Parameters:
V
- the type of the decorated vertex valueE
- the type of the decorated edge value
- All Superinterfaces:
Iterable<Vertex<V,E>>
,MetaTagCollection
- All Known Implementing Classes:
GraphImpl
public interface Graph<V,E> extends MetaTagCollection, Iterable<Vertex<V,E>>
Interface for a graph representation
- Since:
- 1.0
- Author:
- Andreas Pointner
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Set<Edge<V,E>>
getEdges()
returns all edges that are inside the graph.GraphStateAccessor<V,E>
getGraphState()
The current state the graph is inCollection<Vertex<V,E>>
getVertices()
gets value of field verticesvoid
setVertexTraversalStrategy(TraversalStrategy<Vertex<V,E>,Edge<V,E>> traversalStrategy)
Sets the traversal strategydefault Stream<Vertex<V,E>>
stream()
Creates a stream and streams the verticesvoid
traverseEdges(VertexVisitor<V,E> visitor, EdgeVisitor<V,E> edgeVisitor)
traverses through the graphvoid
traverseVertices(VertexVisitor<V,E> visitor)
traverses through the graph-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface science.aist.gtf.graph.MetaTagCollection
addMetaTag, getMetaTags, getMetaTagValue, getMetaTagValue, removeMetaTag, removeMetaTag, tryGetMetaTagValue, tryGetMetaTagValue
-
-
-
-
Method Detail
-
getVertices
Collection<Vertex<V,E>> getVertices()
gets value of field vertices- Returns:
- value of field vertices
-
getEdges
default Set<Edge<V,E>> getEdges()
returns all edges that are inside the graph.
Note: this operation traverses every node, and could therefore be extremely slow for big graphs
- Returns:
- all edges that are inside the graph
-
setVertexTraversalStrategy
void setVertexTraversalStrategy(TraversalStrategy<Vertex<V,E>,Edge<V,E>> traversalStrategy)
Sets the traversal strategy- Parameters:
traversalStrategy
- the traversal strategy
-
traverseVertices
void traverseVertices(VertexVisitor<V,E> visitor)
traverses through the graph- Parameters:
visitor
- the visitor which is executed for every visited vertex
-
traverseEdges
void traverseEdges(VertexVisitor<V,E> visitor, EdgeVisitor<V,E> edgeVisitor)
traverses through the graph- Parameters:
visitor
- the visitor which his executed for every visited vertexedgeVisitor
- the visitor which is executed for every visited edge
-
stream
default Stream<Vertex<V,E>> stream()
Creates a stream and streams the vertices- Returns:
- stream of vertices
-
getGraphState
GraphStateAccessor<V,E> getGraphState()
The current state the graph is in- Returns:
- the graph state object in the background which is used inside the graph
-
-