dk.brics.xpath.evaluator
Class Reachability

java.lang.Object
  extended by dk.brics.xpath.evaluator.Reachability

public class Reachability
extends Object


Constructor Summary
Reachability(XMLGraph xg)
          Creates a new reachability relation for the given XML graph.
Reachability(XMLGraph xg, Set<Integer> roots)
          Creates a new reachability relation for the given XML graph.
 
Method Summary
 HashSet<Integer> getDefinitelyReachableFrom(int i)
          Gets the set of node indices (ConcreteNode) that are "definitely reachable from" the given node index (ElementNode).
 Set<Integer> getDefinitelyTransitiveReachableFrom(int i)
          Gets the set of node indices (ConcreteNode) that are "definitely transitive reachable from" the given node index (ElementNode).
 Set<Integer> getReachableFrom(int i)
          Gets the set of node indices (ConcreteNode) that are "reachable from" the given node index (ElementNode).
 Set<Integer> getReachesTo(int i)
          Gets the set of node indices (ElementNode) that "reaches to" a given node index (ConcreteNode).
 Set<Integer> getReachesTransitiveTo(int i)
          Gets the set of node indices (ElementNode) that "reaches transitive to" a given node index (ConcreteNode).
 Set<Integer> getTransitiveReachableFrom(int i)
          Gets the set of node indices (ConcreteNode) that are "transitive reachable from" the given node index (ElementNode).
 boolean isReachable(int node)
           
static void prettyprint(PrintStream out, Reachability r)
           
 void printReachabilityOf(PrintStream out, String from, String to)
           
 void transitiveClosure(Map<Integer,dk.brics.xpath.evaluator.Reachability.ReachabilitySet> map)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reachability

public Reachability(XMLGraph xg)
Creates a new reachability relation for the given XML graph.

Parameters:
xg - XML graph

Reachability

public Reachability(XMLGraph xg,
                    Set<Integer> roots)
Creates a new reachability relation for the given XML graph.

Parameters:
xg - XML graph
roots - set of nodes to consider roots instead of xg's root set
Method Detail

getDefinitelyReachableFrom

public HashSet<Integer> getDefinitelyReachableFrom(int i)
Gets the set of node indices (ConcreteNode) that are "definitely reachable from" the given node index (ElementNode). A node index j is "definitely reachable from" a node index i iff j occurs at least once in every unfolding starting from node i.

Parameters:
i - index
Returns:
set of indices "definitely reachable from" index i

getDefinitelyTransitiveReachableFrom

public Set<Integer> getDefinitelyTransitiveReachableFrom(int i)
Gets the set of node indices (ConcreteNode) that are "definitely transitive reachable from" the given node index (ElementNode). A node index j is "definitely transitive reachable from" a node index i iff j occurs at least once in every transitive unfolding starting from node i.

Parameters:
i - index
Returns:
set of indices "definitely reachable from" index i

getReachableFrom

public Set<Integer> getReachableFrom(int i)
Gets the set of node indices (ConcreteNode) that are "reachable from" the given node index (ElementNode). A node index j is "reachable from" a node index i iff j occurs at least once in some unfolding starting from node index i.

Parameters:
i - index
Returns:
set of indices "reachable from" index i

getReachesTo

public Set<Integer> getReachesTo(int i)
Gets the set of node indices (ElementNode) that "reaches to" a given node index (ConcreteNode). A node index j "reaches to" a node index i if i occurs in some unfolding starting from j.

Parameters:
i - index
Returns:
set of indices that "reaches to" index i

getReachesTransitiveTo

public Set<Integer> getReachesTransitiveTo(int i)
Gets the set of node indices (ElementNode) that "reaches transitive to" a given node index (ConcreteNode). A node index j "reaches transitive to" a node index i if i occurs in some transitive unfolding starting from j.

Parameters:
i - index
Returns:
set of indices that "reaches to" index i

getTransitiveReachableFrom

public Set<Integer> getTransitiveReachableFrom(int i)
Gets the set of node indices (ConcreteNode) that are "transitive reachable from" the given node index (ElementNode). A node index j is "transitive reachable from" a node index i iff j occurs at least once in some transitive unfolding starting from node index i.

Parameters:
i - index
Returns:
set of indices "transitive reachable from" index i

isReachable

public boolean isReachable(int node)

prettyprint

public static void prettyprint(PrintStream out,
                               Reachability r)

printReachabilityOf

public void printReachabilityOf(PrintStream out,
                                String from,
                                String to)

transitiveClosure

public void transitiveClosure(Map<Integer,dk.brics.xpath.evaluator.Reachability.ReachabilitySet> map)


Copyright © 2005-2010 Anders Møller.