|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.savarese.algorithms.graph.AdjacencyList<V,E>
public class AdjacencyList<V,E extends Edge<V,?>>
An AdjacencyList represents a graph by mapping a set of vertices to
the set of edges emanating from each vertex.
| Constructor Summary | |
|---|---|
AdjacencyList()
Creates an empty adjacency list. |
|
| Method Summary | |
|---|---|
void |
add(E edge)
Adds an edge to the graph, mapping the source vertex to the edge. |
void |
addVertex(V vertex)
Adds a vertex to the graph with no edges associated with it. |
void |
clear()
Removes all vertices and edges from the graph. |
java.util.Set<E> |
edgeSet(V v)
Returns a set containing all of the edges emanating from a given vertex. |
int |
size()
Returns the number of vertices in the graph. |
java.util.Set<V> |
vertexSet()
Returns the set of vertices in the graph. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AdjacencyList()
| Method Detail |
|---|
public void add(E edge)
Graph
add in interface Graph<V,E extends Edge<V,?>>edge - The edge to add.public void addVertex(V vertex)
Graph
addVertex in interface Graph<V,E extends Edge<V,?>>vertex - The vertex to add.public void clear()
Graph
clear in interface Graph<V,E extends Edge<V,?>>public java.util.Set<E> edgeSet(V v)
Graph
edgeSet in interface Graph<V,E extends Edge<V,?>>v - A source vertex.
public int size()
Graph
size in interface Graph<V,E extends Edge<V,?>>public java.util.Set<V> vertexSet()
Graph
vertexSet in interface Graph<V,E extends Edge<V,?>>
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||