V
- Type of vertices in the graph.E
- Type of edges in the graphpublic interface IGraph<V,E extends IGraphEdge<V>>
IGraphEdge
. There may only be a single directional
edge from any vertex to any other vertex. For example, there can be an edge
from A to B and another edge from B to A. However it is impossible to store a
second edge from A to B.Modifier and Type | Method and Description |
---|---|
boolean |
addVertex(V vertex)
Adds a vertex to the graph.
|
E |
getEdge(V from,
V to)
Gets the edge in the graph that connects the two specified vertices.
|
Set<E> |
getIncomingEdges(V vertex)
Finds all the edges terminating at the specified vertex.
|
Set<E> |
getOutgoingEdges(V vertex)
Finds all the edges emanating from the specified vertex.
|
Set<V> |
getVertices()
Gets the set of all vertices in the graph.
|
E |
removeEdge(E edge)
Removes the specified edge or the edge in the graph that conects the same
two vertices as the specified edge from the graph.
|
void |
removeVertex(V vertex)
Removes a vertex from the graph
|
E |
setEdge(E edge)
Set the edge between the vertex returned from
IGraphEdge.getFrom() and the vertex returned from
IGraphEdge.getTo() . |
boolean addVertex(V vertex)
vertex
- Vertex to addvoid removeVertex(V vertex)
vertex
- Vertex to remove.E setEdge(E edge)
IGraphEdge.getFrom()
and the vertex returned from
IGraphEdge.getTo()
. The the graph already contained an edge
between those two vertices that edge is replaced with the specified edge
and returned from this method.edge
- The new edge to add to the graph.E getEdge(V from, V to)
from
- to
- Set<E> getOutgoingEdges(V vertex)
Set<E> getIncomingEdges(V vertex)
E removeEdge(E edge)
edge
- Edge to remove from the graph.Copyright © 2016 The Apache Software Foundation. All rights reserved.