Package ghidra.program.model.address

# Interface AddressIterator

All Superinterfaces:
  `Iterable<Address>`, `Iterator<Address>`

All Known Implementing Classes:
  `AddressIteratorAdapter`, `AddressIteratorAdapter`, `AddressIteratorConverter`, `AddressKeyAddressIterator`, `CommentTypeFilterAddressIterator`, `EmptyAddressIterator`, `IndexedAddressIterator`

public interface AddressIterator extends Iterator<Address>, Iterable<Address>

AddressIterator is used to iterate over some set of addresses.

Note: The next and previous methods return Addresss.

See Also:
  - `CollectionUtils.asIterable(T)`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final AddressIterator`
  `EMPTY_ITERATOR`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `hasNext()`
  Checks if there is a next address in the iteration.
  `default Iterator<Address>`
  `iterator()`
  `Address`
  `next()`
  Get the next address.

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

  `forEach, spliterator`

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

  `forEachRemaining, remove`

- ## Field Details

  - ### EMPTY_ITERATOR

    static final AddressIterator EMPTY_ITERATOR

- ## Method Details

  - ### next

    Address next()
    Get the next address.

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

    Specified by:
      `next` in interface `Iterator<Address>`
    Returns:
      the next address in the iteration.

  - ### hasNext

    boolean hasNext()
    Checks if there is a next address in the iteration.
    Specified by:
      `hasNext` in interface `Iterator<Address>`
    Returns:
      true if there is a next address.

  - ### iterator

    default Iterator<Address> iterator()
    Specified by:
      `iterator` in interface `Iterable<Address>`