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

    • getLength

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

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

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

      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

      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

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

      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

      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

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

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

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

      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