jpaul.Graphs
Class GraphUtil

java.lang.Object
  extended by jpaul.Graphs.GraphUtil

public abstract class GraphUtil
extends java.lang.Object

GraphUtil contains various graph utilities.

Version:
$Id: GraphUtil.java,v 1.5 2005/10/05 16:37:05 salcianu Exp $
Author:
Alexandru Salcianu - salcianu@alum.mit.edu

Constructor Summary
GraphUtil()
           
 
Method Summary
static
<Vertex> ForwardNavigator<Vertex>
cachedFwdNavigator(ForwardNavigator<Vertex> fnav)
           
static
<Vertex> Navigator<Vertex>
reverseNav(Navigator<Vertex> nav)
          Returns the reverse of a given navigator.
static
<V> ForwardNavigator<V>
unionFwdNav(ForwardNavigator<V> fn1, ForwardNavigator<V> fn2)
          Unions two ForwardNavigator.
static
<V> Navigator<V>
unionNav(Navigator<V> n1, Navigator<V> n2)
          Unions two Navigator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphUtil

public GraphUtil()
Method Detail

unionNav

public static <V> Navigator<V> unionNav(Navigator<V> n1,
                                        Navigator<V> n2)
Unions two Navigator. For each vertex v, successors/predecessors indicated by the union navigator consist of all the successors/predecessors indicated by n1, followed by all the successors/predecessors indicated by n2. Note that the same successor/predecessor may be indicated twice, once by fn1 and once by fn2.


unionFwdNav

public static <V> ForwardNavigator<V> unionFwdNav(ForwardNavigator<V> fn1,
                                                  ForwardNavigator<V> fn2)
Unions two ForwardNavigator. For each vertex v, successors indicated by the union navigator consist of all the successors indicated by fn1, followed by all the successors indicated by fn2. Note that the same successors may be indicated twice, once by fn1 and once by fn2.


reverseNav

public static <Vertex> Navigator<Vertex> reverseNav(Navigator<Vertex> nav)
Returns the reverse of a given navigator. In the resulting reverse navigator, the next method returns the same result as nav.prev, and the prev method returns the same result as nav.next.


cachedFwdNavigator

public static <Vertex> ForwardNavigator<Vertex> cachedFwdNavigator(ForwardNavigator<Vertex> fnav)


Copyright 2005 Alexandru Salcianu - salcianu@alum.mit.edu