|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjcommon.graph.impl.AdjacencyList<TVertex,TValue,TProcessedValue>
public class AdjacencyList<TVertex extends IVertex<TValue>,TValue,TProcessedValue>
IAdjacencyList| Constructor Summary | |
|---|---|
AdjacencyList(Set<TVertex> vertices,
Set<IEdge<TVertex>> edges)
|
|
| Method Summary | |
|---|---|
int[] |
calculateInDegrees()
Calculates an integer array where the value at each index is the number of times that vertex is referenced elsewhere. |
Map<TValue,TProcessedValue> |
createResultMap()
Creates an instance of a Map that's properly sized for holding a
mapping of values to their processed result. |
Set<TVertex> |
getEndingVertices()
Provides a Set that contains vertices who have no out neighbors. |
int |
indexOf(IVertex vertex)
Find the index in the IAdjacencyList at which the provided vertex argument can be found. |
boolean |
isEmpty()
Determines if the adjacency list is empty. |
boolean |
isEndingVertex(TVertex vertex)
Determines if the provided vertex parameter is in the set of ending vertices. |
Iterator<IAdjacencyListPair<TVertex>> |
iterator()
|
List<TVertex> |
outNeighborsAt(int index)
Gets the list of out-neighbors for a given vertex of TVertex at the provided index argument. |
List<TVertex> |
outNeighborsFor(TVertex vertex)
Gets the list of out-neighbors for a given vertex of TVertex. |
IAdjacencyListPair<TVertex> |
pairAt(int index)
Retrieves an instance of IAdjacencyListPair at the specified index. |
int |
size()
The size of the IAdjacencyList. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AdjacencyList(Set<TVertex> vertices,
Set<IEdge<TVertex>> edges)
IAdjacencyList| Method Detail |
|---|
public int[] calculateInDegrees()
calculateInDegrees in interface IAdjacencyList<TVertex extends IVertex<TValue>,TValue,TProcessedValue>IAdjacencyList.size() representing the in-degrees for each vertex.public IAdjacencyListPair<TVertex> pairAt(int index)
IAdjacencyListIAdjacencyListPair at the specified index.
pairAt in interface IAdjacencyList<TVertex extends IVertex<TValue>,TValue,TProcessedValue>index - The index in the list for which we wish to get the associated IAdjacencyListPair.
IAdjacencyListPair if found; otherwise null.IAdjacencyListPairpublic List<TVertex> outNeighborsAt(int index)
IAdjacencyListTVertex at the provided index argument.
outNeighborsAt in interface IAdjacencyList<TVertex extends IVertex<TValue>,TValue,TProcessedValue>index - The index in the list for which we wish to get the associated out-neighbors.
TVertex instances who are the out-neighbors for an instance of TVertex
at the specified index.IAdjacencyListPair.getOutNeighbors()public List<TVertex> outNeighborsFor(TVertex vertex)
IAdjacencyListTVertex.
outNeighborsFor in interface IAdjacencyList<TVertex extends IVertex<TValue>,TValue,TProcessedValue>vertex - A vertex of TVertex for whom we wish to retrieve its out-neighbors.
TVertex instances who are the out-neighbors for the provided vertex argument.IAdjacencyListPair.getOutNeighbors()public boolean isEmpty()
IAdjacencyList
isEmpty in interface IAdjacencyList<TVertex extends IVertex<TValue>,TValue,TProcessedValue>true if the adjacency list is empty; false otherwise.public int size()
IAdjacencyListIAdjacencyList. This is the same as the number of vertices in the IGraph.
size in interface IAdjacencyList<TVertex extends IVertex<TValue>,TValue,TProcessedValue>IAdjacencyList.public Set<TVertex> getEndingVertices()
IAdjacencyListSet that contains vertices who have no out neighbors.
getEndingVertices in interface IAdjacencyList<TVertex extends IVertex<TValue>,TValue,TProcessedValue>Set containing vertices with no out neighbors.public Iterator<IAdjacencyListPair<TVertex>> iterator()
iterator in interface Iterable<IAdjacencyListPair<TVertex extends IVertex<TValue>>>public int indexOf(IVertex vertex)
IAdjacencyListIAdjacencyList at which the provided vertex argument can be found.
indexOf in interface IAdjacencyList<TVertex extends IVertex<TValue>,TValue,TProcessedValue>vertex - An instance of IVertex of TVertex.
IAdjacencyList at which the provided vertex argument can be found.
-1 if the vertex cannot be found.public boolean isEndingVertex(TVertex vertex)
IAdjacencyList
isEndingVertex in interface IAdjacencyList<TVertex extends IVertex<TValue>,TValue,TProcessedValue>vertex - The vertex for whom you wish to test for set membership.
true if the vertex is in the set of ending vertices; false otherwise.IAdjacencyList.getEndingVertices()public Map<TValue,TProcessedValue> createResultMap()
IAdjacencyListMap that's properly sized for holding a
mapping of values to their processed result.
createResultMap in interface IAdjacencyList<TVertex extends IVertex<TValue>,TValue,TProcessedValue>Map mapping values to their processed result.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||