Class GraphImpl<V,​E>

  • Type Parameters:
    V - the type of the decorated vertex value
    E - the type of the decorated edge value
    All Implemented Interfaces:
    Iterable<Vertex<V,​E>>, Graph<V,​E>, MetaTagCollection

    public class GraphImpl<V,​E>
    extends MetaTagCollectionImpl
    implements Graph<V,​E>

    Implementation of a graph

    Since:
    1.0
    Author:
    Andreas Schuler, Andreas Pointner
    • Constructor Detail

      • GraphImpl

        public GraphImpl()
    • Method Detail

      • create

        public static <V,​E> Graph<V,​E> create​(GraphStateAccessor<V,​E> graphState)
        Creates a new Graph
        Type Parameters:
        V - the type of the decorated vertex value
        E - the type of the decorated edge value
        Parameters:
        graphState - the internal data state representation of the graph
        Returns:
        a new graph
      • getVertices

        public Collection<Vertex<V,​E>> getVertices()
        Description copied from interface: Graph
        gets value of field vertices
        Specified by:
        getVertices in interface Graph<V,​E>
        Returns:
        value of field vertices
      • traverseVertices

        public void traverseVertices​(VertexVisitor<V,​E> visitor)
        traverses through the graph
        Specified by:
        traverseVertices in interface Graph<V,​E>
        Parameters:
        visitor - the visitor which is executed for every visited vertex
      • traverseEdges

        public void traverseEdges​(VertexVisitor<V,​E> visitor,
                                  EdgeVisitor<V,​E> edgeVisitor)
        traverses through the graph
        Specified by:
        traverseEdges in interface Graph<V,​E>
        Parameters:
        visitor - the visitor which his executed for every visited vertex
        edgeVisitor - the visitor which is executed for every visited edge
      • iterator

        public Iterator<Vertex<V,​E>> iterator()
        Iterates over all Vertices (depth first Search Strategy)
        Specified by:
        iterator in interface Iterable<V>
        Returns:
        iterator for vertices