public class Addr32 extends Object implements IAddress, Serializable
| Modifier and Type | Field and Description |
|---|---|
static Addr32 |
MAX |
static BigInteger |
MAX_OFFSET |
static Addr32 |
ZERO |
| Constructor and Description |
|---|
Addr32(byte[] addrBytes) |
Addr32(long rawaddress) |
Addr32(long rawaddress,
boolean truncate) |
Addr32(String addr) |
Addr32(String addr,
boolean truncate) |
Addr32(String addr,
int radix) |
Addr32(String addr,
int radix,
boolean truncate) |
| Modifier and Type | Method and Description |
|---|---|
IAddress |
add(BigInteger offset)
Adds offset to address and returns new address object
which is the result
|
IAddress |
add(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, see IAddress.add(BigInteger offset) to handle larger offsets. |
int |
compareTo(Object other) |
BigInteger |
distanceTo(IAddress other)
Returns distance to address.
|
boolean |
equals(Object x)
Returns whether this address equals the given object.
|
int |
getCharsNum()
Returns amount of symbols in hex representation.
|
BigInteger |
getMaxOffset()
Returns maximal offset possible for address.
|
int |
getSize()
Returns the address size in bytes.
|
BigInteger |
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.
|
String |
toBinaryAddressString()
Converts address to the binary representation with '0b' prefix and
with all leading zeros.
|
String |
toHexAddressString()
Converts address to the hex representation with '0x' prefix and
with all leading zeros.
|
String |
toOctalAddressString() |
String |
toString()
Identical to toString(10)
|
String |
toString(int radix)
Converts address to string as an unsigned number with given radix
|
public static final Addr32 ZERO
public static final Addr32 MAX
public static final BigInteger MAX_OFFSET
public Addr32(byte[] addrBytes)
public Addr32(long rawaddress)
public Addr32(long rawaddress,
boolean truncate)
public Addr32(String addr)
public Addr32(String addr, boolean truncate)
public Addr32(String addr, int radix)
public Addr32(String addr, int radix, boolean truncate)
public IAddress add(BigInteger offset)
IAddresspublic IAddress add(long offset)
IAddressIAddress.add(BigInteger offset) to handle larger offsets.public BigInteger getMaxOffset()
IAddressgetMaxOffset in interface IAddresspublic BigInteger getValue()
IAddresspublic BigInteger distanceTo(IAddress other)
IAddressdistanceTo in interface IAddressother - address which distance is calculated to.public int compareTo(Object other)
compareTo in interface Comparable<Object>public boolean isMax()
IAddresspublic boolean isZero()
IAddresspublic String toString()
IAddresspublic String toString(int radix)
IAddresspublic boolean equals(Object x)
IAddresspublic String toHexAddressString()
IAddresstoHexAddressString in interface IAddresspublic String toOctalAddressString()
public String toBinaryAddressString()
IAddresstoBinaryAddressString in interface IAddresspublic int getCharsNum()
IAddressgetCharsNum in interface IAddressCopyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.