Class ReachabilityPredicate


  • public class ReachabilityPredicate
    extends java.lang.Object
    Checks if the given node is reachable from nodes marked as uninteresting. Works only with VCS dags (dags where id of children nodes is greater than id of parent nodes).

    Example of usage:

       ReachabilityPredicate p = VcsDAGs.createReachabilityPredicate(dag);
       p.markUninteresting(node1); //marks node1 and all nodes reachable from it as uninteresting
       p.isInteresting(node2); //returns true if node2 is not reachable from node1
       p.markUninteresting(node2); //marks node2 and all nodes reachable from it as uninteresting
       dag.breadthFirstSearch(node3, p.createBfsVisitor(visitor)); //visitor will be called for all nodes reachable from node3 excluding nodes reachable form node1 and node2
       p.markUninteresting(node4);
       dag.depthFirstSearch(node5, p.createDfsVisitor(visitor)); //visitor will be called for nodes reachable from node5 excluding nodes reachable form node1, node2, and node4
     
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      jetbrains.buildServer.util.graph.BFSVisitor<java.lang.Long> createBfsVisitor​(jetbrains.buildServer.util.graph.BFSVisitor<java.lang.Long> delegate)
      Returns a BFS search calling the specified delegate only for interesting nodes
      jetbrains.buildServer.util.graph.DFSVisitor<java.lang.Long> createDfsVisitor​(jetbrains.buildServer.util.graph.DFSVisitor<java.lang.Long> delegate)
      Returns a DFS search calling the specified delegate only for interesting nodes
      boolean isInteresting​(java.lang.Long node)
      Returns true if the given node is interesting, ie.
      void markUninteresting​(long node)
      Marks specified node and all reachable from it as uninteresting
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isInteresting

        public boolean isInteresting​(java.lang.Long node)
        Returns true if the given node is interesting, ie. it is not marked as uninteresting and is not reachable from uninteresting nodes
        Parameters:
        node - node of interest
        Returns:
        see above
      • markUninteresting

        public void markUninteresting​(long node)
        Marks specified node and all reachable from it as uninteresting
        Parameters:
        node - node to mark
      • createBfsVisitor

        @NotNull
        public jetbrains.buildServer.util.graph.BFSVisitor<java.lang.Long> createBfsVisitor​(@NotNull
                                                                                            jetbrains.buildServer.util.graph.BFSVisitor<java.lang.Long> delegate)
        Returns a BFS search calling the specified delegate only for interesting nodes
        Parameters:
        delegate - delegate visitor to call
        Returns:
        see above
      • createDfsVisitor

        @NotNull
        public jetbrains.buildServer.util.graph.DFSVisitor<java.lang.Long> createDfsVisitor​(@NotNull
                                                                                            jetbrains.buildServer.util.graph.DFSVisitor<java.lang.Long> delegate)
        Returns a DFS search calling the specified delegate only for interesting nodes
        Parameters:
        delegate - delegate visitor to call
        Returns:
        see above