Package jetbrains.buildServer.util.graph
Class ModificationDAGInt
- java.lang.Object
-
- jetbrains.buildServer.util.graph.DAG<Long>
-
- jetbrains.buildServer.util.graph.BaseModificationDAG
-
- jetbrains.buildServer.util.graph.ModificationDAGInt
-
public class ModificationDAGInt extends BaseModificationDAG
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsNode(Long node)Check if graph contains specified nodeprotected voidfillSelfChildren(Long node, List<Long> accumulator)Set<Long>getAllNodes()protected Collection<Pair<Long,Long>>getInitialEdges()longgetMaxNode()List<Long>getNodesWithoutParents()Returns nodes without parentsList<Long>getParents(Long node)Get parents of the specified nodeprotected List<Long>getSelfParents(Long node)protected DAG<Long>getTail()booleanhasParents(Long node)Returns true if the given node has parentsbooleanisEmpty()protected voidprocessNodesWithoutChildren(ItemProcessor<Long> nodesProcessor)Passes nodes without children to the specified processor.protected intselfSize()intsize()Returns number of nodes in the graphList<Long>toposort()Get topologically sorted list of graph nodes (parents go before children)-
Methods inherited from class jetbrains.buildServer.util.graph.BaseModificationDAG
breadthFirstSearch, breadthFirstSearch, filter, getCommonAncestors, getDepthFirstSearch, getNodesWithoutChildren, getReverseDepthFirstSearch, iterator, iterator, iterator, reverseBreadthFirstSearch, reverseBreadthFirstSearch, tailSize, toposortFrom
-
Methods inherited from class jetbrains.buildServer.util.graph.DAG
depthFirstSearch, ensureContainsNode, exclude, filter, filter, getChildren, getCommonAncestors, getNodesWithMissingParents, include, include, splitIsolatedDAGs
-
-
-
-
Method Detail
-
toposort
@NotNull public List<Long> toposort()
Description copied from class:DAGGet topologically sorted list of graph nodes (parents go before children)
-
getParents
@NotNull public List<Long> getParents(@NotNull Long node)
Description copied from class:DAGGet parents of the specified node- Specified by:
getParentsin classDAG<Long>- Parameters:
node- node of interest- Returns:
- see above
-
getSelfParents
@Nullable protected List<Long> getSelfParents(@NotNull Long node)
- Specified by:
getSelfParentsin classDAG<Long>
-
hasParents
public boolean hasParents(@NotNull Long node)Description copied from class:DAGReturns true if the given node has parents- Overrides:
hasParentsin classDAG<Long>- Parameters:
node- node of interest- Returns:
- see above
-
fillSelfChildren
protected void fillSelfChildren(@NotNull Long node, @NotNull List<Long> accumulator)- Specified by:
fillSelfChildrenin classDAG<Long>
-
containsNode
public boolean containsNode(@NotNull Long node)Description copied from class:DAGCheck if graph contains specified node- Specified by:
containsNodein classDAG<Long>- Parameters:
node- node to check- Returns:
- true if graph contains node, false otherwise
-
processNodesWithoutChildren
protected void processNodesWithoutChildren(@NotNull ItemProcessor<Long> nodesProcessor)Description copied from class:DAGPasses nodes without children to the specified processor.- Specified by:
processNodesWithoutChildrenin classDAG<Long>
-
getNodesWithoutParents
@NotNull public List<Long> getNodesWithoutParents()
Description copied from class:DAGReturns nodes without parents- Specified by:
getNodesWithoutParentsin classDAG<Long>- Returns:
- see above
-
size
public int size()
Description copied from class:DAGReturns number of nodes in the graph
-
selfSize
protected int selfSize()
-
getInitialEdges
@NotNull protected Collection<Pair<Long,Long>> getInitialEdges()
-
getAllNodes
@NotNull public Set<Long> getAllNodes()
- Specified by:
getAllNodesin classDAG<Long>
-
getMaxNode
public long getMaxNode()
- Specified by:
getMaxNodein classBaseModificationDAG- Returns:
- max node from the current DAG if it is not empty, otherwise returns 0
-
-