Package ghidra.util

Enum Class AddressRangeIterators

java.lang.Object
java.lang.Enum<AddressRangeIterators>
ghidra.util.AddressRangeIterators
All Implemented Interfaces:
Serializable, Comparable<AddressRangeIterators>, Constable

public enum AddressRangeIterators extends Enum<AddressRangeIterators>
Utilities for manipulating iterators over AddressRanges. Notably, this allows the creation of lazily computed set operations on AddressSetViews.
  • Method Details

    • values

      public static AddressRangeIterators[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AddressRangeIterators valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • castOrWrap

      public static AddressRangeIterator castOrWrap(Iterator<AddressRange> it)
      Utility for satisfying the type checker. This just forwards the method calls so that an Iterator over AddressRange can be used where an AddressRangeIterator is required. If only Java had type aliasing....
      Parameters:
      it - the iterator
      Returns:
      the wrapper, or the same iterator if it is already an AddressRangeIterator
    • union

      public static AddressRangeIterator union(Collection<Iterator<AddressRange>> iterators, boolean forward)
      Create an iterator over the union of address ranges in the given iterators
      Parameters:
      iterators - the iterators to union
      forward - true for forward iteration. The given iterators must all return ranges in the order indicated by this flag.
      Returns:
      the iterator over the union
      See Also:
    • doCheckStart

      protected static boolean doCheckStart(AddressRange range, Address start, boolean forward)
    • subtract

      public static AddressRangeIterator subtract(Iterator<AddressRange> a, Iterator<AddressRange> b, Address start, boolean forward)
      Create an iterator over the difference between two address range iterators
      Parameters:
      a - the minuend
      b - the subtrahend
      start - the starting address, or null
      forward - true for forward iteration. The given iterators must all return ranges in the order indicated by this flag.
      Returns:
      the iterator over the difference
      See Also:
    • xor

      public static AddressRangeIterator xor(Iterator<AddressRange> a, Iterator<AddressRange> b, Address start, boolean forward)
      Create an iterator over the symmetric difference between two address range iterators
      Parameters:
      a - the first iterator
      b - the second iterator
      start - the starting address, or null
      forward - true for forward iteration. The given iterators must all return ranges in the order indicated by this flag.
      Returns:
      the iterator over the symmetric difference
      See Also:
    • intersect

      public static AddressRangeIterator intersect(Iterator<AddressRange> a, Iterator<AddressRange> b, boolean forward)
      Create an iterator over the intersection between two address range iterators
      Parameters:
      a - the first iterator
      b - the second iterator
      forward - true for forward iteration. The given iterators must all return ranges in the order indicated by this flag.
      Returns:
      the iterator over the symmetric difference
      See Also: