V
- Class of the Vertex of the Graph.E
- Class of the Edges of the Graph.public class AdjacencyListGraph<V extends Vertex,E extends Edge<V>> extends java.lang.Object implements Graph<V,E>
Graph
structure using adjacency lists to store the
edges of the graph.Modifier and Type | Field and Description |
---|---|
protected java.lang.Class<?> |
edgeClass
Class of the edges of the graph
|
Constructor and Description |
---|
AdjacencyListGraph(java.lang.Class<?> edgeClass,
java.lang.Class<?> vertexClass) |
Modifier and Type | Method and Description |
---|---|
E |
addEdge(V arg0,
V arg1)
Method that add a new edge that join the parameter vertices.
|
boolean |
addVertex(V arg0)
Method to add a new Vertex to the graph.
|
boolean |
containsVertex(V arg0)
Method to check if a vertex is contained in the graph,
|
java.util.Set<E> |
edgeSet()
Method that returns the set of Edges contained in this graph.
|
java.util.Set<E> |
edgesFrom(V vertex)
Method that return a set of edge where everyone has a certain source vertex.
|
java.util.Set<java.util.Set<V>> |
getConnectedComponents(java.lang.Boolean strongConnected)
Method that gets the connected components of the graph.
|
java.lang.Class<? extends E> |
getEdgeClass()
Method to get the Edge class of the Graph.
|
EdgeFactory<V,E> |
getEdgeFactory()
Method to get the Edge Factory to create new edges for this graph.
|
AdjacencyListGraph<V,E> |
getSimilarType()
Method that return a new Graph with the same class of vertices and edges.
|
java.util.Collection<V> |
getSubTree(DirectedSearchIterator<V> iterator)
Method that gives the vertices of the graph that, given an Interator over the vertices, are found
iterating it.
|
java.lang.Class<? extends V> |
getVertexClass()
Method to get the Vertex class of the Graph.
|
VertexFactory<V> |
getVertexFactory()
Method to get the Vertex Factory to create new edges for this graph.
|
AdjacencyListGraph<V,E> |
inducedSubgraph(java.util.Collection<V> nodes)
Method to get the induced sub-graph given a collection of vertices.
|
boolean |
removeEdge(E arg0)
Method to remove an edge of the graph.
|
boolean |
removeVertex(V arg0)
Method that remove a vertex from the graph.
|
protected void |
setLoopsAvaible(boolean loopsAvaible)
Setter method to the
loopsAvaible parameter. |
java.util.Set<V> |
vertexSet()
Method that returns the set of Vertex contained in this graph.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsEdge, containsEdge, edgesOf, edgesTo, getAllEdges, getEdge, getEdgeSource, getEdgeTarget, getEdgeWeight, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, vertexFrom, vertexTo
public AdjacencyListGraph(java.lang.Class<?> edgeClass, java.lang.Class<?> vertexClass)
protected void setLoopsAvaible(boolean loopsAvaible)
loopsAvaible
parameter.loopsAvaible
- Boolean value which will be set as
loopsAvaible
parameter.public E addEdge(V arg0, V arg1)
Graph
public boolean addVertex(V arg0)
Graph
public boolean containsVertex(V arg0)
Graph
public java.util.Set<E> edgeSet()
Graph
public EdgeFactory<V,E> getEdgeFactory()
Graph
getEdgeFactory
in interface Graph<V extends Vertex,E extends Edge<V>>
EdgeFactory
<V,E>public VertexFactory<V> getVertexFactory()
Graph
getVertexFactory
in interface Graph<V extends Vertex,E extends Edge<V>>
VertexFactory
<V>public boolean removeEdge(E arg0)
Graph
public boolean removeVertex(V arg0)
Graph
public java.util.Set<V> vertexSet()
Graph
public java.util.Set<E> edgesFrom(V vertex)
Graph
public java.lang.Class<? extends E> getEdgeClass()
Graph
public java.lang.Class<? extends V> getVertexClass()
Graph
public AdjacencyListGraph<V,E> inducedSubgraph(java.util.Collection<V> nodes)
nodes
- Collection of vertices which will be in the induced sub-graphpublic java.util.Collection<V> getSubTree(DirectedSearchIterator<V> iterator)
iterator
- Iterator that will be iterated until it give no more vertices.public java.util.Set<java.util.Set<V>> getConnectedComponents(java.lang.Boolean strongConnected)
strongConnected
- Parameter indicating if get Strongly or Normal Connected componentspublic AdjacencyListGraph<V,E> getSimilarType()