Package ghidra.program.model.block
Class SubroutineSourceReferenceIterator
- java.lang.Object
-
- ghidra.program.model.block.SubroutineSourceReferenceIterator
-
- All Implemented Interfaces:
CodeBlockReferenceIterator
public class SubroutineSourceReferenceIterator extends java.lang.Object implements CodeBlockReferenceIterator
SubroutineSourceReferenceIterator is a unidirectional iterator over the sourceCodeBlockReferences for a CodeBlock.
-
-
Constructor Summary
Constructors Constructor Description SubroutineSourceReferenceIterator(CodeBlock block, TaskMonitor monitor)Construct an Iterator over Source blocks for a CodeBlock.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intgetNumSources(CodeBlock block, TaskMonitor monitor)Get number of source references flowing from this subroutine (block).booleanhasNext()Return true if next() will return a CodeBlockReference.CodeBlockReferencenext()Return the next CodeBlockReference.
-
-
-
Constructor Detail
-
SubroutineSourceReferenceIterator
public SubroutineSourceReferenceIterator(CodeBlock block, TaskMonitor monitor) throws CancelledException
Construct an Iterator over Source blocks for a CodeBlock.- Parameters:
block- block to get destination blocks for. This should be a subroutine obtained from SubroutineBlockModel.monitor- task monitor which allows user to cancel operation.- Throws:
CancelledException- if the monitor cancels the operation.
-
-
Method Detail
-
next
public CodeBlockReference next() throws CancelledException
Description copied from interface:CodeBlockReferenceIteratorReturn the next CodeBlockReference.- Specified by:
nextin interfaceCodeBlockReferenceIterator- Throws:
CancelledException- thrown if the operation is cancelled.- See Also:
CodeBlockReferenceIterator.next()
-
hasNext
public boolean hasNext() throws CancelledExceptionDescription copied from interface:CodeBlockReferenceIteratorReturn true if next() will return a CodeBlockReference.- Specified by:
hasNextin interfaceCodeBlockReferenceIterator- Throws:
CancelledException- thrown if the operation is cancelled.- See Also:
CodeBlockReferenceIterator.hasNext()
-
getNumSources
public static int getNumSources(CodeBlock block, TaskMonitor monitor) throws CancelledException
Get number of source references flowing from this subroutine (block). All Calls to this block, and all external FlowType block references to this block are counted.- Parameters:
block- code block to get the number of source references to.monitor- task monitor which allows user to cancel operation.- Throws:
CancelledException- if the monitor cancels the operation.
-
-