|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
TVertex - Type of IVertex.public interface IAdjacencyList<TVertex extends IVertex<TValue>,TValue,TProcessedValue>
An adjacency list is essentially an array of size n where A[i] is the list of out-neighbors of node i. Please see the following for a more thorough explanation: http://www.cs.cmu.edu/~avrim/451f08/lectures/lect1002.pdf Implementations of this interface must be thread safe.
| Method Summary | |
|---|---|
int[] |
calculateInDegrees()
Scans the IAdjacencyList and for each vertex it counts the number of other vertices referencing it. |
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(TVertex 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. |
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 interface java.lang.Iterable |
|---|
iterator |
| Method Detail |
|---|
boolean isEmpty()
true if the adjacency list is empty; false otherwise.List<TVertex> outNeighborsFor(TVertex vertex)
TVertex.
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()IAdjacencyListPair<TVertex> pairAt(int index)
IAdjacencyListPair at the specified index.
index - The index in the list for which we wish to get the associated IAdjacencyListPair.
IAdjacencyListPair if found; otherwise null.IAdjacencyListPairList<TVertex> outNeighborsAt(int index)
TVertex at the provided index argument.
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()int indexOf(TVertex vertex)
IAdjacencyList at which the provided vertex argument can be found.
vertex - An instance of IVertex of TVertex.
IAdjacencyList at which the provided vertex argument can be found.
-1 if the vertex cannot be found.int[] calculateInDegrees()
IAdjacencyList and for each vertex it counts the number of other vertices referencing it.
size() representing the in-degrees for each vertex.int size()
IAdjacencyList. This is the same as the number of vertices in the IGraph.
IAdjacencyList.Set<TVertex> getEndingVertices()
Set that contains vertices who have no out neighbors.
Set containing vertices with no out neighbors.boolean isEndingVertex(TVertex vertex)
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.getEndingVertices()Map<TValue,TProcessedValue> createResultMap()
Map that's properly sized for holding a
mapping of values to their processed result.
Map mapping values to their processed result.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||