Class ReachabilityIndexExtImpl<T>

    • Constructor Detail

      • ReachabilityIndexExtImpl

        public ReachabilityIndexExtImpl​(@NotNull
                                        gnu.trove.TObjectIntHashMap<T> node2PostOrderNumber,
                                        @NotNull
                                        T[] postOrderNumber2Node,
                                        @NotNull
                                        long[][] intervals)
    • Method Detail

      • addEdges

        public void addEdges​(@NotNull
                             T child,
                             @NotNull
                             List<T> parents)
        Description copied from interface: ReachabilityIndexExt
        Extends index with additional edges from the specified child node to the given parent nodes
        Specified by:
        addEdges in interface ReachabilityIndexExt<T>
        Parameters:
        child - child node of interest, must not be present in the index
        parents - parent nodes of interest, must be present in the index
      • containsNode

        public boolean containsNode​(@NotNull
                                    T node)
      • getPostOrderNumber

        protected int getPostOrderNumber​(@NotNull
                                         T node)
      • getIntervals

        protected long[] getIntervals​(int poNum)
      • getNode

        protected T getNode​(int poNum)
      • processReachable

        public void processReachable​(@NotNull
                                     T from,
                                     @NotNull
                                     ItemProcessor<T> processor)
        Description copied from interface: ReachabilityIndex
        Process all reachable nodes from the given node from with specified processor. The node from is also processed.
        Specified by:
        processReachable in interface ReachabilityIndex<T>
        Parameters:
        from - a node which reachable nodes to process
        processor - nodes processor
      • isReachable

        public boolean isReachable​(@NotNull
                                   T node,
                                   @NotNull
                                   T from)
        Description copied from interface: ReachabilityIndex
        Returns true if the given node node is reachable from specified node from. Node is reachable from itself.
        Specified by:
        isReachable in interface ReachabilityIndex<T>
        Parameters:
        node - a node which reachability should be tested
        from - a node from which reachability should be tested
        Returns:
        see above
      • createReachablePredicate

        @NotNull
        public Predicate<T> createReachablePredicate​(@NotNull
                                                     T from)
        Description copied from interface: ReachabilityIndex
        Returns a reachability predicate which returns true if the node is reachable from the specified node from.
        Specified by:
        createReachablePredicate in interface ReachabilityIndex<T>
        Parameters:
        from - a node from which reachability should be tested by predicate
        Returns:
        see above