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 void
addEdges(T child, List<T> parents)
Extends index with additional edges from the specified child node to the given parent nodesboolean
containsNode(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 T
getNode(int poNum)
protected int
getPostOrderNumber(T node)
boolean
isReachable(T node, T from)
Returns true if the given nodenode
is reachable from specified nodefrom
.void
processReachable(T from, ItemProcessor<T> processor)
Process all reachable nodes from the given nodefrom
with 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:ReachabilityIndexExt
Extends index with additional edges from the specified child node to the given parent nodes- Specified by:
addEdges
in 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:ReachabilityIndex
Process all reachable nodes from the given nodefrom
with specified processor. The nodefrom
is also processed.- Specified by:
processReachable
in 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:ReachabilityIndex
Returns true if the given nodenode
is reachable from specified nodefrom
. Node is reachable from itself.- Specified by:
isReachable
in 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:ReachabilityIndex
Returns a reachability predicate which returns true if the node is reachable from the specified nodefrom
.- Specified by:
createReachablePredicate
in interfaceReachabilityIndex<T>
- Parameters:
from
- a node from which reachability should be tested by predicate- Returns:
- see above
-
-