|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javautils.collections.Algs | +--javautils.graph.testing.BasicGraph
Basic implementation of the Graph
-inferface for testing.
Field Summary |
Fields inherited from class javautils.collections.Algs |
EMPTY_ARRAY, EMPTY_LIST, EMPTY_MAP, EMPTY_SEQUENCE, EMPTY_SET |
Constructor Summary | |
BasicGraph(java.lang.Object[][] graph)
A Graph created from the given "association table" representation. |
Method Summary | |
java.util.List |
edgesFrom(java.lang.Object node)
List of all edges from the specified source node. |
java.util.List |
nodes()
List of all nodes. |
java.lang.Object |
sourceOf(java.lang.Object edge)
The source node of the edge. |
java.lang.Object |
targetOf(java.lang.Object edge)
The target node of the edge. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicGraph(java.lang.Object[][] graph)
A Graph created from the given "association table" representation.
Method Detail |
public java.util.List nodes()
Graph
List of all nodes.
Important: This method should have O(1)
time
complexity. This means that you should avoid constructing the list
each time this method is called.
Note: The order of nodes in the returned list may have an effect on the results of graph algorithms.
nodes
in interface Graph
public java.util.List edgesFrom(java.lang.Object node)
Graph
List of all edges from the specified source node.
Important: This method should have O(1)
time
complexity. This means that you should avoid constructing the list
each time this method is called.
Note: The order of edges in the returned list may have an effect on the results of graph algorithms.
edgesFrom
in interface Graph
public java.lang.Object sourceOf(java.lang.Object edge)
Graph
The source node of the edge.
sourceOf
in interface Graph
public java.lang.Object targetOf(java.lang.Object edge)
Graph
The target node of the edge.
targetOf
in interface Graph
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |