java.lang.Object
com.ibm.j9ddr.corereaders.memory.BaseMemoryRange
- All Implemented Interfaces:
IMemoryRange,Comparable<IMemoryRange>
- Direct Known Subclasses:
MemoryRange,ProtectedMemoryRange
Abstract base class containing common logic for IMemoryRange
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares this object with the specified object for order.booleancontains(long address) Checks whether an address is present in this memory rangefinal longfinal longgetSize()final longbooleanisBacked()booleanisSubRange(IMemoryRange other) booleanoverlaps(IMemoryRange other) Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface com.ibm.j9ddr.corereaders.memory.IMemoryRange
getAddressSpaceId, getName, isExecutable, isReadOnly, isShared
-
Field Details
-
baseAddress
protected final long baseAddress -
size
protected final long size
-
-
Constructor Details
-
BaseMemoryRange
protected BaseMemoryRange(long baseAddress, long size)
-
-
Method Details
-
contains
public boolean contains(long address) Description copied from interface:IMemoryRangeChecks whether an address is present in this memory range- Specified by:
containsin interfaceIMemoryRange- Parameters:
address- Address to test- Returns:
- True if the memory range contains address, false otherwise.
-
compareTo
Description copied from interface:java.lang.ComparableCompares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.The implementor must ensure
signum(x.compareTo(y)) == -signum(y.compareTo(x))for allxandy. (This implies thatx.compareTo(y)must throw an exception if and only ify.compareTo(x)throws an exception.)The implementor must also ensure that the relation is transitive:
(x.compareTo(y) > 0 && y.compareTo(z) > 0)impliesx.compareTo(z) > 0.Finally, the implementor must ensure that
x.compareTo(y)==0implies thatsignum(x.compareTo(z)) == signum(y.compareTo(z)), for allz.- Specified by:
compareToin interfaceComparable<IMemoryRange>- Parameters:
o- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
-
isSubRange
- Specified by:
isSubRangein interfaceIMemoryRange- Parameters:
other-- Returns:
- True if other models a memory range that sits entirely within this range
-
overlaps
- Specified by:
overlapsin interfaceIMemoryRange- Parameters:
other-- Returns:
- True if other shares any addresses with this range.
-
getBaseAddress
public final long getBaseAddress()- Specified by:
getBaseAddressin interfaceIMemoryRange- Returns:
- Base address of this memory range
-
getSize
public final long getSize()- Specified by:
getSizein interfaceIMemoryRange- Returns:
- Size of this memory range, bytes
-
getTopAddress
public final long getTopAddress()- Specified by:
getTopAddressin interfaceIMemoryRange- Returns:
- Largest address in this memory range
-
isBacked
public boolean isBacked()- Specified by:
isBackedin interfaceIMemoryRange
-