Class GraphStateImpl<V,​E>

  • Type Parameters:
    V - the type of the decorated vertex value
    E - the type of the decorated edge value
    All Implemented Interfaces:
    GraphState<V,​E>, GraphStateAccessor<V,​E>

    public class GraphStateImpl<V,​E>
    extends Object
    implements GraphState<V,​E>

    Represents a current state of a graph

    Since:
    1.0
    Author:
    Andreas Pointner
    • Constructor Detail

      • GraphStateImpl

        public GraphStateImpl()
    • Method Detail

      • getEdges

        public Set<Edge<V,​E>> getEdges​(Vertex<V,​E> vertex)
        Description copied from interface: GraphStateAccessor
        returns the edges for a given vertex
        Specified by:
        getEdges in interface GraphStateAccessor<V,​E>
        Parameters:
        vertex - the vertex for which the edges should be retrieved
        Returns:
        the set of edges for the given vertex
      • getSource

        public Vertex<V,​E> getSource​(Edge<V,​E> edge)
        Description copied from interface: GraphStateAccessor
        Returns the source vertex for a given edge
        Specified by:
        getSource in interface GraphStateAccessor<V,​E>
        Parameters:
        edge - the edge for which the source vertex should be returned
        Returns:
        the source vertex of the given
      • getTarget

        public Vertex<V,​E> getTarget​(Edge<V,​E> edge)
        Description copied from interface: GraphStateAccessor
        Returns the target vertex for a given edge
        Specified by:
        getTarget in interface GraphStateAccessor<V,​E>
        Parameters:
        edge - the edge for which the target vertex should be returned
        Returns:
        the target vertex of the given
      • addVertex

        public void addVertex​(Vertex<V,​E> vertex)
        Description copied from interface: GraphState
        Adds a vertex to the graph state
        Specified by:
        addVertex in interface GraphState<V,​E>
        Parameters:
        vertex - the vertex to add
      • addEdge

        public void addEdge​(Edge<V,​E> edge,
                            Vertex<V,​E> source,
                            Vertex<V,​E> target)
        Description copied from interface: GraphState
        Adds an edge between given source and target vertex
        Specified by:
        addEdge in interface GraphState<V,​E>
        Parameters:
        edge - the edge to add
        source - the source vertex
        target - the target vertex