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 void
breadthFirstSearch(Long start, BFSVisitor<Long> visitor)
Run breadth-first search from the specified start nodevoid
breadthFirstSearch(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 nodesModificationDagDFS
getDepthFirstSearch(Long start, DFSVisitor<Long> visitor)
Returns depth-first search from the specified start nodeabstract long
getMaxNode()
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 graphvoid
reverseBreadthFirstSearch(Long start, BFSVisitor<Long> visitor)
void
reverseBreadthFirstSearch(Set<Long> starts, BFSVisitor<Long> visitor)
int
tailSize()
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:DAG
Get iterator through the nodes of the graph. Same as iterator(getNodesWithoutChildren())- Overrides:
iterator
in 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:DAG
Get iterator through the nodes of the graph
-
iterator
@NotNull public DAGIterator<Long> iterator(@NotNull Collection<Long> startNodes)
Description copied from class:DAG
Get 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:DAG
Run breadth-first search from the specified start node- Specified by:
breadthFirstSearch
in classDAG<Long>
- Parameters:
start
- start node for the searchvisitor
- visitor
-
breadthFirstSearch
public void breadthFirstSearch(@NotNull Set<Long> starts, @NotNull BFSVisitor<Long> visitor)
- Specified by:
breadthFirstSearch
in classDAG<Long>
-
reverseBreadthFirstSearch
public void reverseBreadthFirstSearch(@NotNull Long start, @NotNull BFSVisitor<Long> visitor)
- Specified by:
reverseBreadthFirstSearch
in classDAG<Long>
-
reverseBreadthFirstSearch
public void reverseBreadthFirstSearch(@NotNull Set<Long> starts, @NotNull BFSVisitor<Long> visitor)
- Specified by:
reverseBreadthFirstSearch
in classDAG<Long>
-
getDepthFirstSearch
public ModificationDagDFS getDepthFirstSearch(@NotNull Long start, @NotNull DFSVisitor<Long> visitor)
Description copied from class:DAG
Returns depth-first search from the specified start node- Specified by:
getDepthFirstSearch
in 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:
getReverseDepthFirstSearch
in classDAG<Long>
-
getCommonAncestors
@NotNull public List<Long> getCommonAncestors(@NotNull List<Long> nodes)
Description copied from class:DAG
Get list of common ancestors for collection of graph nodes- Specified by:
getCommonAncestors
in 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:DAG
Returns nodes without children- Specified by:
getNodesWithoutChildren
in 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
-
-