public class SynchronizedGraph<V,E extends IGraphEdge<V>> extends Graph<V,E>
Constructor and Description |
---|
SynchronizedGraph() |
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.
|
Lock |
readLock() |
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(V from,
V to,
E e) |
Lock |
writeLock() |
addVertices, setEdge
public boolean addVertex(V vertex)
IGraph
public void removeVertex(V vertex)
IGraph
removeVertex
in interface IGraph<V,E extends IGraphEdge<V>>
removeVertex
in class Graph<V,E extends IGraphEdge<V>>
vertex
- Vertex to remove.public E getEdge(V from, V to)
IGraph
public Set<E> getOutgoingEdges(V vertex)
IGraph
getOutgoingEdges
in interface IGraph<V,E extends IGraphEdge<V>>
getOutgoingEdges
in class Graph<V,E extends IGraphEdge<V>>
public Set<E> getIncomingEdges(V vertex)
IGraph
getIncomingEdges
in interface IGraph<V,E extends IGraphEdge<V>>
getIncomingEdges
in class Graph<V,E extends IGraphEdge<V>>
public E removeEdge(E edge)
IGraph
removeEdge
in interface IGraph<V,E extends IGraphEdge<V>>
removeEdge
in class Graph<V,E extends IGraphEdge<V>>
edge
- Edge to remove from the graph.public Set<V> getVertices()
IGraph
getVertices
in interface IGraph<V,E extends IGraphEdge<V>>
getVertices
in class Graph<V,E extends IGraphEdge<V>>
public Lock writeLock()
public Lock readLock()
Copyright © 2016 The Apache Software Foundation. All rights reserved.