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 boolean
containsNode(Long node)
Check if graph contains specified nodeprotected void
fillSelfChildren(Long node, List<Long> accumulator)
Set<Long>
getAllNodes()
protected Collection<Pair<Long,Long>>
getInitialEdges()
long
getMaxNode()
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()
boolean
hasParents(Long node)
Returns true if the given node has parentsboolean
isEmpty()
protected void
processNodesWithoutChildren(ItemProcessor<Long> nodesProcessor)
Passes nodes without children to the specified processor.protected int
selfSize()
int
size()
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:DAG
Get topologically sorted list of graph nodes (parents go before children)
-
getParents
@NotNull public List<Long> getParents(@NotNull Long node)
Description copied from class:DAG
Get parents of the specified node- Specified by:
getParents
in classDAG<Long>
- Parameters:
node
- node of interest- Returns:
- see above
-
getSelfParents
@Nullable protected List<Long> getSelfParents(@NotNull Long node)
- Specified by:
getSelfParents
in classDAG<Long>
-
hasParents
public boolean hasParents(@NotNull Long node)
Description copied from class:DAG
Returns true if the given node has parents- Overrides:
hasParents
in classDAG<Long>
- Parameters:
node
- node of interest- Returns:
- see above
-
fillSelfChildren
protected void fillSelfChildren(@NotNull Long node, @NotNull List<Long> accumulator)
- Specified by:
fillSelfChildren
in classDAG<Long>
-
containsNode
public boolean containsNode(@NotNull Long node)
Description copied from class:DAG
Check if graph contains specified node- Specified by:
containsNode
in 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:DAG
Passes nodes without children to the specified processor.- Specified by:
processNodesWithoutChildren
in classDAG<Long>
-
getNodesWithoutParents
@NotNull public List<Long> getNodesWithoutParents()
Description copied from class:DAG
Returns nodes without parents- Specified by:
getNodesWithoutParents
in classDAG<Long>
- Returns:
- see above
-
size
public int size()
Description copied from class:DAG
Returns 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:
getAllNodes
in classDAG<Long>
-
getMaxNode
public long getMaxNode()
- Specified by:
getMaxNode
in classBaseModificationDAG
- Returns:
- max node from the current DAG if it is not empty, otherwise returns 0
-
-