Class BlockChunkFinder

java.lang.Object
org.jenkinsci.plugins.workflow.graphanalysis.BlockChunkFinder
All Implemented Interfaces:
ChunkFinder

public class BlockChunkFinder extends Object implements ChunkFinder
Matches start and end of a block. Any block!
Author:
Sam Van Oort
  • Constructor Details

    • BlockChunkFinder

      public BlockChunkFinder()
  • Method Details

    • isStartInsideChunk

      public boolean isStartInsideChunk()
      NOTE: you will need to handle cases where you have a BlockStartNode where the BlockEndNode has not been generated yet! This means you need to keep nodes around even after hitting the EndNode
      Specified by:
      isStartInsideChunk in interface ChunkFinder
    • isChunkStart

      public boolean isChunkStart(@NonNull FlowNode current, @CheckForNull FlowNode previous)
      Description copied from interface: ChunkFinder
      Test if the current node is the start of a new chunk (inclusive)
      Specified by:
      isChunkStart in interface ChunkFinder
      Parameters:
      current - Node to test for being a start, it will begin the chunk and be included
      previous - Previous node, to use in testing chunk
      Returns:
      True if current node is the beginning of chunk
    • isChunkEnd

      public boolean isChunkEnd(@NonNull FlowNode current, @CheckForNull FlowNode previous)
      Description copied from interface: ChunkFinder
      Test if the current node is the end of a chunk (inclusive)
      Specified by:
      isChunkEnd in interface ChunkFinder
      Parameters:
      current - Node to test for being end

      For a block, the BlockEndNode

      For a legacy stage or marker, this will be first node of new stage (previous is the marker)

      previous - Previous node, to use in testing chunk
      Returns:
      True if current is the end of a chunk (inclusive)