|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javautils.graph.GraphDecorator | +--javautils.graph.AugmentedGraphDecorator
A basic forwarding Decorator, see [Gamma1995], for
the AugmentedGraph
-interface. By default, the decorator simply
forwards all operations to the original graph given at construction
time. A class derived from the decorator can then override operations
to alter the behavior of the graph.
Since a derived decorator is allowed to alter the behavior of the graph in any way, like adding nodes or removing edges, it is generally not safe to make any assumptions about the relationship between the original and the decorated graph.
GraphDecorator
Constructor Summary | |
AugmentedGraphDecorator(AugmentedGraph graph)
|
Method Summary | |
protected AugmentedGraph |
augmented()
The original graph. |
java.util.List |
edgesTo(java.lang.Object node)
List of all edges to the specified target node. |
boolean |
isNode(java.lang.Object obj)
True if and only if the object is a node of this graph. |
Methods inherited from class javautils.graph.GraphDecorator |
edgesFrom, graph, nodes, sourceOf, targetOf |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javautils.graph.adt.Graph |
edgesFrom, nodes, sourceOf, targetOf |
Constructor Detail |
public AugmentedGraphDecorator(AugmentedGraph graph)
Method Detail |
public boolean isNode(java.lang.Object obj)
AugmentedGraph
True if and only if the object is a node of this graph.
isNode
in interface AugmentedGraph
public java.util.List edgesTo(java.lang.Object node)
AugmentedGraph
List of all edges to the specified target 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.
edgesTo
in interface AugmentedGraph
protected final AugmentedGraph augmented()
The original graph.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |