Package org.eclipse.cdt.utils
Class Addr32
java.lang.Object
org.eclipse.cdt.utils.Addr32
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,IAddress
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(long offset) Adds offset to address and returns new address object which is the result
Note: This method has an offset limit of Long.MAX and Long.MIN, which under some addressing schemes may impose an unnecessary limitation, seeIAddress.add(BigInteger offset)
to handle larger offsets.add
(BigInteger offset) Adds offset to address and returns new address object which is the resultint
distanceTo
(IAddress other) Returns distance to address.boolean
Returns whether this address equals the given object.int
Returns amount of symbols in hex representation.Returns maximal offset possible for address.int
getSize()
Returns the address size in bytes.getValue()
Returns the value of the address.int
hashCode()
boolean
isMax()
Return true if address is maximal, i.e.boolean
isZero()
Return true if address is zero, i.e.Converts address to the binary representation with '0b' prefix and with all leading zeros.Converts address to the hex representation with '0x' prefix and with all leading zeros.toString()
Identical to toString(10)toString
(int radix) Converts address to string as an unsigned number with given radix
-
Field Details
-
ZERO
-
MAX
-
MAX_OFFSET
-
-
Constructor Details
-
Addr32
public Addr32(byte[] addrBytes) -
Addr32
public Addr32(long rawaddress) -
Addr32
public Addr32(long rawaddress, boolean truncate) -
Addr32
-
Addr32
-
Addr32
-
Addr32
-
-
Method Details
-
add
Description copied from interface:IAddress
Adds offset to address and returns new address object which is the result -
add
Description copied from interface:IAddress
Adds offset to address and returns new address object which is the result
Note: This method has an offset limit of Long.MAX and Long.MIN, which under some addressing schemes may impose an unnecessary limitation, seeIAddress.add(BigInteger offset)
to handle larger offsets. -
getMaxOffset
Description copied from interface:IAddress
Returns maximal offset possible for address. The offset should be identical for all addresses of given class.- Specified by:
getMaxOffset
in interfaceIAddress
- Returns:
- the max offset for this address class
-
getValue
Description copied from interface:IAddress
Returns the value of the address. -
distanceTo
Description copied from interface:IAddress
Returns distance to address. Distance may be positive or negative- Specified by:
distanceTo
in interfaceIAddress
- Parameters:
other
- address which distance is calculated to.- Returns:
- distance to address
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Object>
-
isMax
public boolean isMax()Description copied from interface:IAddress
Return true if address is maximal, i.e. maximal possible -
isZero
public boolean isZero()Description copied from interface:IAddress
Return true if address is zero, i.e. minimal possible -
toString
Description copied from interface:IAddress
Identical to toString(10) -
toString
Description copied from interface:IAddress
Converts address to string as an unsigned number with given radix -
equals
Description copied from interface:IAddress
Returns whether this address equals the given object. -
hashCode
public int hashCode() -
toHexAddressString
Description copied from interface:IAddress
Converts address to the hex representation with '0x' prefix and with all leading zeros. The length of returned string should be the same for all addresses of given class. I.e. 10 for 32-bit addresses and 18 for 64-bit addresses- Specified by:
toHexAddressString
in interfaceIAddress
-
toOctalAddressString
- Since:
- 5.4
-
toBinaryAddressString
Description copied from interface:IAddress
Converts address to the binary representation with '0b' prefix and with all leading zeros. The length of returned string should be the same for all addresses of given class. I.e. 34 for 32-bit addresses and 66 for 64-bit addresses- Specified by:
toBinaryAddressString
in interfaceIAddress
-
getCharsNum
public int getCharsNum()Description copied from interface:IAddress
Returns amount of symbols in hex representation. Is identical to toHexAddressString().length(). It is present for performance purpose.- Specified by:
getCharsNum
in interfaceIAddress
- Returns:
- the number of character symbols to represent this address in hex.
-
getSize
public int getSize()Description copied from interface:IAddress
Returns the address size in bytes.
-