public class Addr64 extends Object implements IAddress, Serializable
| Modifier and Type | Field and Description |
|---|---|
static Addr64 |
MAX |
static BigInteger |
MAX_OFFSET |
static Addr64 |
ZERO |
| Constructor and Description |
|---|
Addr64(BigInteger rawaddress) |
Addr64(BigInteger rawaddress,
boolean truncate) |
Addr64(byte[] addrBytes) |
Addr64(long addr)
Create an address represented by long bits.
|
Addr64(String addr) |
Addr64(String addr,
boolean truncate) |
Addr64(String addr,
int radix) |
Addr64(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 Addr64 ZERO
public static final Addr64 MAX
public static final BigInteger MAX_OFFSET
public Addr64(byte[] addrBytes)
public Addr64(BigInteger rawaddress)
public Addr64(BigInteger rawaddress, boolean truncate)
public Addr64(String addr)
public Addr64(long addr)
public Addr64(String addr, boolean truncate)
public Addr64(String addr, int radix)
public Addr64(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 distanceTo(IAddress other)
IAddressdistanceTo in interface IAddressother - address which distance is calculated to.public boolean isMax()
IAddresspublic boolean isZero()
IAddresspublic BigInteger getValue()
IAddresspublic int compareTo(Object other)
compareTo in interface Comparable<Object>public boolean equals(Object x)
IAddresspublic String toString()
IAddresspublic String toString(int radix)
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.