Interface AddressRange

All Superinterfaces:
Comparable<AddressRange>, Iterable<Address>
All Known Implementing Classes:
AddressRangeImpl

public interface AddressRange extends Comparable<AddressRange>, Iterable<Address>
The AddressRange interface is used by any object that represents a contiguous inclusive range of addresses from a minimum address to a maximum address. The entire range must fall within a single address space.

Since:
2000-02-16
See Also:
  • Method Details Link icon

    • getLength Link icon

      long getLength()
      Returns the number of addresses in the range.
    • getBigLength Link icon

      BigInteger getBigLength()
      Returns the number of addresses as a BigInteger.
      Returns:
      the number of addresses as a BigInteger.
    • contains Link icon

      boolean contains(Address addr)
      Returns true if the given address is contained in the range.
    • intersect Link icon

      AddressRange intersect(AddressRange range)
      Computes the intersection of this range with another.
      Parameters:
      range - the range to intersect this range with
      Returns:
      AddressRange the intersection or null if the ranges do not intersect.
    • intersectRange Link icon

      AddressRange intersectRange(Address start, Address end)
      Computes the intersection of this range with another.
      Parameters:
      start - of range
      end - end of range
      Returns:
      AddressRange the intersection or null if the ranges do not intersect.
    • intersects Link icon

      boolean intersects(AddressRange range)
      Returns true if the given range intersects this range.
      Parameters:
      range - the range to test for intersection with.
    • intersects Link icon

      boolean intersects(Address start, Address end)
      Returns true if the given range intersects this range.
      Parameters:
      start - the first address in the range to test for intersection.
      end - the last address in the range to test for intersection.
    • compareTo Link icon

      int compareTo(Address addr)
      Compares the given address to this address range.
      Parameters:
      addr - the address to compare.
      Returns:
      a negative integer if the address is greater than the maximum range address, zero if the address is in the range, and a positive integer if the address is less than minimum range address.
    • getMaxAddress Link icon

      Address getMaxAddress()
      Returns:
      the maximum address in the range.
    • getMinAddress Link icon

      Address getMinAddress()
      Returns:
      the minimum address in the range.
    • getAddressSpace Link icon

      AddressSpace getAddressSpace()
      Returns:
      address space this range resides within
    • checkValidRange Link icon

      static void checkValidRange(Address start, Address end)
      Change the specified start and end addresses to see if they form a valid range within the same AddressSpace.
      Parameters:
      start - range start address
      end - range end address