public class ChildNumber extends java.lang.Object implements java.lang.Comparable<ChildNumber>
This is just a wrapper for the i (child number) as per BIP 32 with a boolean getter for the most significant bit
and a getter for the actual 0-based child number. A List
of these forms a path through a
DeterministicHierarchy
. This class is immutable.
Modifier and Type | Field and Description |
---|---|
static int |
HARDENED_BIT
The bit that's set in the child number to indicate whether this key is "hardened".
|
static ChildNumber |
ONE |
static ChildNumber |
ONE_HARDENED |
static ChildNumber |
ZERO |
static ChildNumber |
ZERO_HARDENED |
Constructor and Description |
---|
ChildNumber(int i) |
ChildNumber(int childNumber,
boolean isHardened) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ChildNumber other) |
boolean |
equals(java.lang.Object o) |
int |
getI()
Returns the uint32 encoded form of the path element, including the most significant bit.
|
int |
hashCode() |
int |
i()
Returns the uint32 encoded form of the path element, including the most significant bit.
|
boolean |
isHardened() |
int |
num()
Returns the child number without the hardening bit set (i.e.
|
java.lang.String |
toString() |
public static final int HARDENED_BIT
public static final ChildNumber ZERO
public static final ChildNumber ZERO_HARDENED
public static final ChildNumber ONE
public static final ChildNumber ONE_HARDENED
public ChildNumber(int childNumber, boolean isHardened)
public ChildNumber(int i)
public int getI()
public int i()
public boolean isHardened()
public int num()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(ChildNumber other)
compareTo
in interface java.lang.Comparable<ChildNumber>