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)
IAddress
public IAddress add(long offset)
IAddress
IAddress.add(BigInteger offset)
to handle larger offsets.public BigInteger getMaxOffset()
IAddress
getMaxOffset
in interface IAddress
public BigInteger getValue()
IAddress
public BigInteger distanceTo(IAddress other)
IAddress
distanceTo
in interface IAddress
other
- address which distance is calculated to.public int compareTo(Object other)
compareTo
in interface Comparable<Object>
public boolean isMax()
IAddress
public boolean isZero()
IAddress
public String toString()
IAddress
public String toString(int radix)
IAddress
public boolean equals(Object x)
IAddress
public String toHexAddressString()
IAddress
toHexAddressString
in interface IAddress
public String toOctalAddressString()
public String toBinaryAddressString()
IAddress
toBinaryAddressString
in interface IAddress
public int getCharsNum()
IAddress
getCharsNum
in interface IAddress
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.