Package ghidra.program.model.block

# Class SubroutineDestReferenceIterator

java.lang.Object
ghidra.program.model.block.SubroutineDestReferenceIterator

All Implemented Interfaces:
  `CodeBlockReferenceIterator`

public class SubroutineDestReferenceIterator extends Object implements CodeBlockReferenceIterator
SubroutineDestReferenceIterator is a unidirectional iterator over the destination `CodeBlockReference`s for a CodeBlock.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SubroutineDestReferenceIterator(CodeBlock block, TaskMonitor monitor)`
  Construct an Iterator over Destination blocks for a CodeBlock.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static int`
  `getNumDestinations(CodeBlock block, TaskMonitor monitor)`
  Get number of destination references flowing out of this subroutine (block).
  `boolean`
  `hasNext()`
  Return true if next() will return a CodeBlockReference.
  `CodeBlockReference`
  `next()`
  Return the next CodeBlockReference.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SubroutineDestReferenceIterator

    public SubroutineDestReferenceIterator(CodeBlock block, TaskMonitor monitor) throws CancelledException
    Construct an Iterator over Destination blocks for a CodeBlock. External references will be ignored.
    Parameters:
      `block` - block to get destination blocks for. This should be a subroutine obtained from PartitionCodeSubModel.
      `monitor` - task monitor which allows user to cancel operation.
    Throws:
      `CancelledException` - if the monitor cancels the operation.

- ## Method Details

  - ### next

    public CodeBlockReference next() throws CancelledException
    Description copied from interface: `CodeBlockReferenceIterator`
    Return the next CodeBlockReference.
    Specified by:
      `next` in interface `CodeBlockReferenceIterator`
    Throws:
      `CancelledException` - thrown if the operation is cancelled.
    See Also:
      - `CodeBlockReferenceIterator.next()`

  - ### hasNext

    public boolean hasNext() throws CancelledException
    Description copied from interface: `CodeBlockReferenceIterator`
    Return true if next() will return a CodeBlockReference.
    Specified by:
      `hasNext` in interface `CodeBlockReferenceIterator`
    Throws:
      `CancelledException` - thrown if the operation is cancelled.
    See Also:
      - `CodeBlockReferenceIterator.hasNext()`

  - ### getNumDestinations

    public static int getNumDestinations(CodeBlock block, TaskMonitor monitor) throws CancelledException
    Get number of destination references flowing out of this subroutine (block). All Calls from this block, and all external FlowType block references from this block are counted.
    Parameters:
      `block` - code block to get the number of destination references from.
      `monitor` - task monitor
    Throws:
      `CancelledException`