Interface Graph<V,​E>

  • Type Parameters:
    V - the type of the decorated vertex value
    E - 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 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 vertex
        edgeVisitor - 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