Package jetbrains.buildServer.util.graph
Class ReachabilityIndexExtImpl<T>
- java.lang.Object
-
- jetbrains.buildServer.util.graph.ReachabilityIndexExtImpl<T>
-
- All Implemented Interfaces:
ReachabilityIndex<T>,ReachabilityIndexExt<T>
public class ReachabilityIndexExtImpl<T> extends Object implements ReachabilityIndexExt<T>
-
-
Constructor Summary
Constructors Constructor Description ReachabilityIndexExtImpl(gnu.trove.TObjectIntHashMap<T> node2PostOrderNumber, T[] postOrderNumber2Node, long[][] intervals)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdges(T child, List<T> parents)Extends index with additional edges from the specified child node to the given parent nodesbooleancontainsNode(T node)Predicate<T>createReachablePredicate(T from)Returns a reachability predicate which returns true if the node is reachable from the specified nodefrom.protected long[]getIntervals(int poNum)protected TgetNode(int poNum)protected intgetPostOrderNumber(T node)booleanisReachable(T node, T from)Returns true if the given nodenodeis reachable from specified nodefrom.voidprocessReachable(T from, ItemProcessor<T> processor)Process all reachable nodes from the given nodefromwith specified processor.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.util.graph.ReachabilityIndex
createReachablePredicate, isReachable, processReachable
-
-
-
-
Method Detail
-
addEdges
public void addEdges(@NotNull T child, @NotNull List<T> parents)Description copied from interface:ReachabilityIndexExtExtends index with additional edges from the specified child node to the given parent nodes- Specified by:
addEdgesin interfaceReachabilityIndexExt<T>- Parameters:
child- child node of interest, must not be present in the indexparents- 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:ReachabilityIndexProcess all reachable nodes from the given nodefromwith specified processor. The nodefromis also processed.- Specified by:
processReachablein interfaceReachabilityIndex<T>- Parameters:
from- a node which reachable nodes to processprocessor- nodes processor
-
isReachable
public boolean isReachable(@NotNull T node, @NotNull T from)Description copied from interface:ReachabilityIndexReturns true if the given nodenodeis reachable from specified nodefrom. Node is reachable from itself.- Specified by:
isReachablein interfaceReachabilityIndex<T>- Parameters:
node- a node which reachability should be testedfrom- a node from which reachability should be tested- Returns:
- see above
-
createReachablePredicate
@NotNull public Predicate<T> createReachablePredicate(@NotNull T from)
Description copied from interface:ReachabilityIndexReturns a reachability predicate which returns true if the node is reachable from the specified nodefrom.- Specified by:
createReachablePredicatein interfaceReachabilityIndex<T>- Parameters:
from- a node from which reachability should be tested by predicate- Returns:
- see above
-
-