Class DepthFirstScanner
java.lang.Object
org.jenkinsci.plugins.workflow.graphanalysis.AbstractFlowScanner
org.jenkinsci.plugins.workflow.graphanalysis.DepthFirstScanner
Does a simple and somewhat efficient depth-first search of all FlowNodes in the DAG.
  
Iteration order: depth-first search, revisiting parallel branches once done.
 The behavior is analogous to FlowGraphWalker but faster.
  With parallel branches, the first branch is explored, then remaining branches are explored in order.
  This keeps ordering compatibility with FlowGraphWalker - it can be a drop-in replacement.
- Author:
- Sam Van Oort
- 
Field SummaryFieldsFields inherited from class org.jenkinsci.plugins.workflow.graphanalysis.AbstractFlowScannerMAX_LIST_CHECK_SIZE, myBlackList, myCurrent, myNext
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected FlowNodenext(FlowNode current, Collection<FlowNode> blackList) Actual meat of the iteration, get the next node to visit, using and updating state as neededprotected booleanprotected voidreset()Reset internal state so that we can begin walking a new flow graph Public APIs need to invoke this before searchesprotected voidsetHeads(Collection<FlowNode> heads) Set up to begin flow scanning using the filteredHeads as starting points This method makes several assumptions: -AbstractFlowScanner.reset()has already been invoked to reset state - filteredHeads has already had any points inAbstractFlowScanner.myBlackListremoved - none of the filteredHeads are nullprotected booleantestCandidate(FlowNode f, Collection<FlowNode> blackList) Methods inherited from class org.jenkinsci.plugins.workflow.graphanalysis.AbstractFlowScannerallNodes, allNodes, convertToFastCheckable, filter, filteredNodes, filteredNodes, filteredNodes, filteredNodes, findFirstMatch, findFirstMatch, findFirstMatch, findFirstMatch, hasNext, iterator, next, remove, setup, setup, setup, setup, visitAll, visitAllMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface java.util.IteratorforEachRemaining
- 
Field Details- 
queue
- 
visited
 
- 
- 
Constructor Details- 
DepthFirstScannerpublic DepthFirstScanner()
 
- 
- 
Method Details- 
resetprotected void reset()Description copied from class:AbstractFlowScannerReset internal state so that we can begin walking a new flow graph Public APIs need to invoke this before searches- Specified by:
- resetin class- AbstractFlowScanner
 
- 
setHeadsDescription copied from class:AbstractFlowScannerSet up to begin flow scanning using the filteredHeads as starting points This method makes several assumptions: -AbstractFlowScanner.reset()has already been invoked to reset state - filteredHeads has already had any points inAbstractFlowScanner.myBlackListremoved - none of the filteredHeads are null- Specified by:
- setHeadsin class- AbstractFlowScanner
- Parameters:
- heads- Head nodes that have been filtered against denyList
 
- 
possibleParallelStart
- 
testCandidate
- 
nextDescription copied from class:AbstractFlowScannerActual meat of the iteration, get the next node to visit, using and updating state as needed- Specified by:
- nextin class- AbstractFlowScanner
- Parameters:
- current- Current node to use in generating next value
- blackList- Nodes that are not eligible for visiting
- Returns:
- Next node to visit, or null if we've exhausted the node list
 
 
-