Class WrappedDAG


  • public class WrappedDAG
    extends BaseModificationDAG
    A DAG implementation which delegates all the calls to a DAG provided by a Supplier.
    Since:
    2024.12
    • Method Detail

      • toposort

        @NotNull
        public List<Long> toposort()
        Description copied from class: DAG
        Get topologically sorted list of graph nodes (parents go before children)
        Specified by:
        toposort in class DAG<Long>
        Returns:
        see above
      • 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
        Overrides:
        getCommonAncestors in class BaseModificationDAG
        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.
      • getParents

        @NotNull
        public List<Long> getParents​(@NotNull
                                     Long node)
        Description copied from class: DAG
        Get parents of the specified node
        Specified by:
        getParents in class DAG<Long>
        Parameters:
        node - node of interest
        Returns:
        see above
      • containsNode

        public boolean containsNode​(@NotNull
                                    Long node)
        Description copied from class: DAG
        Check if graph contains specified node
        Specified by:
        containsNode in class DAG<Long>
        Parameters:
        node - node to check
        Returns:
        true if graph contains node, false otherwise
      • getNodesWithoutParents

        @NotNull
        public List<Long> getNodesWithoutParents()
        Description copied from class: DAG
        Returns nodes without parents
        Specified by:
        getNodesWithoutParents in class DAG<Long>
        Returns:
        see above
      • getMaxNode

        public long getMaxNode()
        Specified by:
        getMaxNode in class BaseModificationDAG
        Returns:
        max node from the current DAG if it is not empty, otherwise returns 0
      • 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
        Overrides:
        breadthFirstSearch in class BaseModificationDAG
        Parameters:
        start - start node for the search
        visitor - visitor
      • size

        public int size()
        Description copied from class: DAG
        Returns number of nodes in the graph
        Specified by:
        size in class DAG<Long>
        Returns:
        see above
      • 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 class DAG<Long>
      • hasParents

        public boolean hasParents​(@NotNull
                                  Long node)
        Description copied from class: DAG
        Returns true if the given node has parents
        Overrides:
        hasParents in class DAG<Long>
        Parameters:
        node - node of interest
        Returns:
        see above
      • iterator

        @NotNull
        public DAGIterator<Long> iterator​(@NotNull
                                          Long startNode)
        Description copied from class: DAG
        Get iterator through the nodes of the graph
        Overrides:
        iterator in class BaseModificationDAG
        Parameters:
        startNode - start node for iteration
        Returns:
        see above
      • iterator

        @NotNull
        public DAGIterator<Long> iterator​(@NotNull
                                          Collection<Long> startNodes)
        Description copied from class: DAG
        Get iterator through the nodes of the graph
        Overrides:
        iterator in class BaseModificationDAG
        Parameters:
        startNodes - start nodes for iteration
        Returns:
        see above
      • exclude

        @NotNull
        public DAG<Long> exclude​(@NotNull
                                 Collection<Long> nodesToExclude)
        Description copied from class: DAG
        Returns DAG which doesn't contain nodes in the specified collection
        Overrides:
        exclude in class DAG<Long>
        Parameters:
        nodesToExclude - collection of nodes resulting DAG should not have
        Returns:
        see above
      • include

        @NotNull
        public DAG<Long> include​(@NotNull
                                 Collection<Long> nodesToInclude)
        Description copied from class: DAG
        Returns DAG which contains only nodes in the specified collection
        Overrides:
        include in class DAG<Long>
        Parameters:
        nodesToInclude - collection of nodes resulting DAG should have
        Returns:
        see above
      • filter

        @NotNull
        public DAG<Long> filter​(@NotNull
                                Filter<Long> filter)
        Description copied from class: DAG
        Returns filtered DAG which contains only nodes accepted by specified filter, same as calling {@link #filter(jetbrains.buildServer.util.filters.Filter, false)}
        Overrides:
        filter in class DAG<Long>
        Parameters:
        filter - filter of interest
        Returns:
        see above
      • filter

        public DAG<Long> filter​(@NotNull
                                Filter<Long> filter,
                                boolean includeAcceptedNodeParents)
        Description copied from class: DAG
        Returns filtered DAG which contains only nodes accepted by specified filter and, if includeAcceptedNodeParents is set to true, their parents
        Overrides:
        filter in class DAG<Long>
        Parameters:
        filter - filter of interest
        includeAcceptedNodeParents - if set to true - all parents of accepted nodes are included into result, if set to false - parents will be filtered and result will include only accepted parents
        Returns:
        see above
      • isEmpty

        public boolean isEmpty()
        Overrides:
        isEmpty in class DAG<Long>
      • getChildren

        @NotNull
        public List<Long> getChildren​(@NotNull
                                      Long node)
        Description copied from class: DAG
        Get children of the specified node
        Overrides:
        getChildren in class DAG<Long>
        Parameters:
        node - node of interest
        Returns:
        see above
      • depthFirstSearch

        public void depthFirstSearch​(@NotNull
                                     Long start,
                                     @NotNull
                                     DFSVisitor<Long> visitor)
        Description copied from class: DAG
        Run depth-first search from the specified start node
        Overrides:
        depthFirstSearch in class DAG<Long>
        Parameters:
        start - start node for the search
        visitor - visitor