Package ghidra.program.util

# Class MultiAddressRangeIterator

java.lang.Object
ghidra.program.util.MultiAddressRangeIterator

public class MultiAddressRangeIterator extends Object
`MultiAddressRangeIterator` is a class for iterating through multiple address range iterators simultaneously. The next() method returns the next address range as determined from all the iterators.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MultiAddressRangeIterator(AddressRangeIterator[] iters)`
  Constructor of a multi address iterator for multiple forward address iterators.
  `MultiAddressRangeIterator(AddressRangeIterator[] iters, boolean forward)`
  Constructor of a multi address range iterator.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AddressRange`
  `backwardNext()`
  Returns the next address for backward iterators.
  `AddressRange`
  `forwardNext()`
  Returns the next address for forward iterators.
  `boolean`
  `hasNext()`
  Determines whether or not any of the original iterators has a next address.
  `AddressRange`
  `next()`
  Returns the next address.

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

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

- ## Constructor Details

  - ### MultiAddressRangeIterator

    public MultiAddressRangeIterator(AddressRangeIterator[] iters)
    Constructor of a multi address iterator for multiple forward address iterators.
    Parameters:
      `iters` - the address iterators.

  - ### MultiAddressRangeIterator

    public MultiAddressRangeIterator(AddressRangeIterator[] iters, boolean forward)
    Constructor of a multi address range iterator.
    Note: all iterators must iterate in the same direction (forwards or backwards).
    Parameters:
      `iters` - the address iterators. All must iterate in the direction indicated by the "forward" parameter.
      `forward` - true indicates that forward iterators are in the array. false indicates backward iterators are in the array.

- ## Method Details

  - ### hasNext

    public boolean hasNext()
    Determines whether or not any of the original iterators has a next address.
    Returns:
      true if a next address can be obtained from any of the address iterators.

  - ### next

    public AddressRange next()
    Returns the next address. The next address could be from any one of the iterators.
    Returns:
      the next address.

  - ### forwardNext

    public AddressRange forwardNext()
    Returns the next address for forward iterators. The next address could be from any one of the iterators.
    Returns:
      the next address.

  - ### backwardNext

    public AddressRange backwardNext()
    Returns the next address for backward iterators. The next address could be from any one of the iterators.
    Returns:
      the next address.