Package jetbrains.buildServer.util.graph
Class BaseModificationDAG
- java.lang.Object
-
- jetbrains.buildServer.util.graph.DAG<Long>
-
- jetbrains.buildServer.util.graph.BaseModificationDAG
-
- Direct Known Subclasses:
LinearDag,ModificationDAG,ModificationDAGInt,WrappedDAG
public abstract class BaseModificationDAG extends DAG<Long>
- Author:
- dmitry.neverov
-
-
Constructor Summary
Constructors Constructor Description BaseModificationDAG()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidbreadthFirstSearch(Long start, BFSVisitor<Long> visitor)Run breadth-first search from the specified start nodevoidbreadthFirstSearch(Set<Long> starts, BFSVisitor<Long> visitor)DAG<Long>filter(Filter<Long> filter, boolean includeAcceptedNodeParents, boolean extrapolateEdges)List<Long>getCommonAncestors(List<Long> nodes)Get list of common ancestors for collection of graph nodesModificationDagDFSgetDepthFirstSearch(Long start, DFSVisitor<Long> visitor)Returns depth-first search from the specified start nodeabstract longgetMaxNode()List<Long>getNodesWithoutChildren()Returns nodes without childrenDepthFirstSearch<Long>getReverseDepthFirstSearch(Long start, DFSVisitor<Long> visitor)DAGIterator<Long>iterator()Get iterator through the nodes of the graph.DAGIterator<Long>iterator(Long startNode)Get iterator through the nodes of the graphDAGIterator<Long>iterator(Collection<Long> startNodes)Get iterator through the nodes of the graphvoidreverseBreadthFirstSearch(Long start, BFSVisitor<Long> visitor)voidreverseBreadthFirstSearch(Set<Long> starts, BFSVisitor<Long> visitor)inttailSize()protected List<Long>toposortFrom(Collection<Long> tips)-
Methods inherited from class jetbrains.buildServer.util.graph.DAG
containsNode, depthFirstSearch, ensureContainsNode, exclude, fillSelfChildren, filter, filter, getAllNodes, getChildren, getCommonAncestors, getNodesWithMissingParents, getNodesWithoutParents, getParents, getSelfParents, hasParents, include, include, isEmpty, processNodesWithoutChildren, size, splitIsolatedDAGs, toposort
-
-
-
-
Method Detail
-
iterator
@NotNull public DAGIterator<Long> iterator()
Description copied from class:DAGGet iterator through the nodes of the graph. Same as iterator(getNodesWithoutChildren())- Overrides:
iteratorin classDAG<Long>- Returns:
- see above
- See Also:
DAG.iterator(java.util.Collection)
-
iterator
@NotNull public DAGIterator<Long> iterator(@NotNull Long startNode)
Description copied from class:DAGGet iterator through the nodes of the graph
-
iterator
@NotNull public DAGIterator<Long> iterator(@NotNull Collection<Long> startNodes)
Description copied from class:DAGGet iterator through the nodes of the graph
-
filter
public DAG<Long> filter(@NotNull Filter<Long> filter, boolean includeAcceptedNodeParents, boolean extrapolateEdges)
-
toposortFrom
@NotNull protected List<Long> toposortFrom(@NotNull Collection<Long> tips)
-
breadthFirstSearch
public void breadthFirstSearch(@NotNull Long start, @NotNull BFSVisitor<Long> visitor)Description copied from class:DAGRun breadth-first search from the specified start node- Specified by:
breadthFirstSearchin classDAG<Long>- Parameters:
start- start node for the searchvisitor- visitor
-
breadthFirstSearch
public void breadthFirstSearch(@NotNull Set<Long> starts, @NotNull BFSVisitor<Long> visitor)- Specified by:
breadthFirstSearchin classDAG<Long>
-
reverseBreadthFirstSearch
public void reverseBreadthFirstSearch(@NotNull Long start, @NotNull BFSVisitor<Long> visitor)- Specified by:
reverseBreadthFirstSearchin classDAG<Long>
-
reverseBreadthFirstSearch
public void reverseBreadthFirstSearch(@NotNull Set<Long> starts, @NotNull BFSVisitor<Long> visitor)- Specified by:
reverseBreadthFirstSearchin classDAG<Long>
-
getDepthFirstSearch
public ModificationDagDFS getDepthFirstSearch(@NotNull Long start, @NotNull DFSVisitor<Long> visitor)
Description copied from class:DAGReturns depth-first search from the specified start node- Specified by:
getDepthFirstSearchin classDAG<Long>- Parameters:
start- start node for the searchvisitor- visitor- Returns:
- see above
-
getReverseDepthFirstSearch
public DepthFirstSearch<Long> getReverseDepthFirstSearch(@NotNull Long start, @NotNull DFSVisitor<Long> visitor)
- Specified by:
getReverseDepthFirstSearchin classDAG<Long>
-
getCommonAncestors
@NotNull public List<Long> getCommonAncestors(@NotNull List<Long> nodes)
Description copied from class:DAGGet list of common ancestors for collection of graph nodes- Specified by:
getCommonAncestorsin classDAG<Long>- Parameters:
nodes- nodes of interest, they should be presented in the graph- Returns:
- least common ancestors or empty list if collection of nodes is empty or if there is no common ancestor between nodes.
-
getNodesWithoutChildren
@NotNull public List<Long> getNodesWithoutChildren()
Description copied from class:DAGReturns nodes without children- Specified by:
getNodesWithoutChildrenin classDAG<Long>- Returns:
- see above
-
tailSize
public int tailSize()
-
getMaxNode
public abstract long getMaxNode()
- Returns:
- max node from the current DAG if it is not empty, otherwise returns 0
- Since:
- 2024.12
-
-