Package ghidra.program.database.code

# Class CommentTypeFilterIterator

java.lang.Object
ghidra.program.database.code.CommentTypeFilterIterator

All Implemented Interfaces:
  `CodeUnitIterator`, `Iterable<CodeUnit>`, `Iterator<CodeUnit>`

public class CommentTypeFilterIterator extends Object implements CodeUnitIterator
Filters the given codeUnit iterator to only return codeUnits that have a comment of the given type

- ## Field Summary

  ### Fields inherited from interface ghidra.program.model.listing.CodeUnitIterator

  `EMPTY_ITERATOR`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CommentTypeFilterIterator(CodeUnitIterator it, int commentType)`
  Constructs a new CommentTypeFilterIterator

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `hasNext()`
  Return true if there is a next CodeUnit.
  `Iterator<CodeUnit>`
  `iterator()`
  `CodeUnit`
  `next()`
  Get the next CodeUnit or null if no more CodeUnits.
  `void`
  `remove()`

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

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

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

  ### Methods inherited from interface java.util.Iterator

  `forEachRemaining`

- ## Constructor Details

  - ### CommentTypeFilterIterator

    public CommentTypeFilterIterator(CodeUnitIterator it, int commentType)
    Constructs a new CommentTypeFilterIterator
    Parameters:
      `it` - a codeunit iterator whose items are tested for the comment type.
      `commentType` - the type of comment to search for.

- ## Method Details

  - ### remove

    public void remove()
    Specified by:
      `remove` in interface `Iterator<CodeUnit>`
    See Also:
      - `Iterator.remove()`

  - ### hasNext

    public boolean hasNext()
    Description copied from interface: `CodeUnitIterator`
    Return true if there is a next CodeUnit.
    Specified by:
      `hasNext` in interface `CodeUnitIterator`
    Specified by:
      `hasNext` in interface `Iterator<CodeUnit>`
    See Also:
      - `CodeUnitIterator.hasNext()`

  - ### next

    public CodeUnit next()
    Description copied from interface: `CodeUnitIterator`
    Get the next CodeUnit or null if no more CodeUnits.

    NOTE: This deviates from the standard `Iterator` interface by returning null instead of throwing an exception.

    Specified by:
      `next` in interface `CodeUnitIterator`
    Specified by:
      `next` in interface `Iterator<CodeUnit>`
    See Also:
      - `CodeUnitIterator.next()`

  - ### iterator

    public Iterator<CodeUnit> iterator()
    Specified by:
      `iterator` in interface `Iterable<CodeUnit>`