Class AugmentedGraphDecorator

All Implemented Interfaces:
AugmentedGraph, Graph
Direct Known Subclasses:
GraphContract, TransposedGraph

public class AugmentedGraphDecorator
extends GraphDecorator
implements AugmentedGraph

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.

See Also:

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)
Description copied from interface: AugmentedGraph

True if and only if the object is a node of this graph.

Specified by:
isNode in interface AugmentedGraph


public java.util.List edgesTo(java.lang.Object node)
Description copied from interface: 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.

Specified by:
edgesTo in interface AugmentedGraph


protected final AugmentedGraph augmented()

The original graph.