jpaul.Graphs
Class GraphUtil

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

public final class GraphUtil
extends java.lang.Object

GraphUtil is a wrapper for various graph utilities. It is a non-instantiatable class with useful static members; it is a graph-equivalent of java.util.Collections.

Version:
$Id: GraphUtil.java,v 1.9 2006/01/29 16:05:29 adam_kiezun Exp $
Author:
Alexandru Salcianu - salcianu@alum.mit.edu

Method Summary
static
<Vertex> ForwardNavigator<Vertex>
cachedFwdNavigator(ForwardNavigator<Vertex> fnav)
           
static
<Vertex> BiDiNavigator<Vertex>
reverseBiDiNavigator(BiDiNavigator<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> BiDiNavigator<V>
unionNav(BiDiNavigator<V> n1, BiDiNavigator<V> n2)
          Unions two BiDiNavigator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

unionNav

public static <V> BiDiNavigator<V> unionNav(BiDiNavigator<V> n1,
                                            BiDiNavigator<V> n2)
Unions two BiDiNavigator. 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.


reverseBiDiNavigator

public static <Vertex> BiDiNavigator<Vertex> reverseBiDiNavigator(BiDiNavigator<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