Package science.aist.gtf.graph.impl
Class GraphStateImpl<V,E>
- java.lang.Object
-
- science.aist.gtf.graph.impl.GraphStateImpl<V,E>
-
- Type Parameters:
V
- the type of the decorated vertex valueE
- 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 Summary
Constructors Constructor Description GraphStateImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEdge(Edge<V,E> edge, Vertex<V,E> source, Vertex<V,E> target)
Adds an edge between given source and target vertexvoid
addVertex(Vertex<V,E> vertex)
Adds a vertex to the graph stateSet<Edge<V,E>>
getEdges(Vertex<V,E> vertex)
returns the edges for a given vertexVertex<V,E>
getSource(Edge<V,E> edge)
Returns the source vertex for a given edgeVertex<V,E>
getTarget(Edge<V,E> edge)
Returns the target vertex for a given edgeCollection<Vertex<V,E>>
getVertices()
returns a snapshot collection of the vertices in the graph state-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface science.aist.gtf.graph.GraphState
readonly
-
-
-
-
Method Detail
-
getVertices
public Collection<Vertex<V,E>> getVertices()
Description copied from interface:GraphStateAccessor
returns a snapshot collection of the vertices in the graph state- Specified by:
getVertices
in interfaceGraphStateAccessor<V,E>
- Returns:
- a snapshot collection of the vertices in the graph state
-
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 interfaceGraphStateAccessor<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 interfaceGraphStateAccessor<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 interfaceGraphStateAccessor<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 interfaceGraphState<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 interfaceGraphState<V,E>
- Parameters:
edge
- the edge to addsource
- the source vertextarget
- the target vertex
-
-