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)
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 distanceTo(IAddress other)
IAddress
distanceTo
in interface IAddress
other
- address which distance is calculated to.public boolean isMax()
IAddress
public boolean isZero()
IAddress
public BigInteger getValue()
IAddress
public int compareTo(Object other)
compareTo
in interface Comparable<Object>
public boolean equals(Object x)
IAddress
public String toString()
IAddress
public String toString(int radix)
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.