Class AsUnweightedDirectedGraph<V,E>

java.lang.Object
org.jgrapht.graph.AbstractGraph<V,E>
org.jgrapht.graph.GraphDelegator<V,E>
org.jgrapht.graph.AsUnweightedDirectedGraph<V,E>
All Implemented Interfaces:
Serializable, DirectedGraph<V,E>, Graph<V,E>

public class AsUnweightedDirectedGraph<V,E> extends GraphDelegator<V,E> implements Serializable, DirectedGraph<V,E>
An unweighted view of the backing weighted graph specified in the constructor. This graph allows modules to apply algorithms designed for unweighted graphs to a weighted graph by simply ignoring edge weights. Query operations on this graph "read through" to the backing graph. Vertex addition/removal and edge addition/removal are all supported (and immediately reflected in the backing graph).

Note that edges returned by this graph's accessors are really just the edges of the underlying directed graph.

This graph does not pass the hashCode and equals operations through to the backing graph, but relies on Object's equals and hashCode methods. This graph will be serializable if the backing graph is serializable.

Since:
Sep 7, 2007
Author:
Lucas J. Scharenbroich
See Also:
  • Constructor Details

    • AsUnweightedDirectedGraph

      public AsUnweightedDirectedGraph(DirectedGraph<V,E> g)
      Constructor for AsUnweightedGraph.
      Parameters:
      g - the backing graph over which an unweighted view is to be created.
  • Method Details