public class HDPath extends AbstractList<ChildNumber>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
hasPrivateKey |
protected List<ChildNumber> |
unmodifiableList |
modCount| Constructor and Description |
|---|
HDPath(boolean hasPrivateKey,
List<ChildNumber> list)
Constructs a path for a public or private key.
|
HDPath(List<ChildNumber> list)
Constructs a path for a public key.
|
| Modifier and Type | Method and Description |
|---|---|
HDPath |
extend(ChildNumber child1,
ChildNumber... children)
Extend the path by appending additional ChildNumber objects.
|
HDPath |
extend(HDPath path2)
Extend the path by appending a relative path.
|
HDPath |
extend(List<ChildNumber> path2)
Extend the path by appending a relative path.
|
ChildNumber |
get(int index) |
boolean |
hasPrivateKey()
Is this a path to a private key?
|
static HDPath |
m()
Returns an empty path for a private key.
|
static HDPath |
M()
Returns an empty path for a public key.
|
static HDPath |
m(ChildNumber... children)
Returns a path for a private key.
|
static HDPath |
M(ChildNumber... children)
Returns a path for a public key.
|
static HDPath |
m(ChildNumber childNumber)
Returns a path for a private key.
|
static HDPath |
M(ChildNumber childNumber)
Returns a path for a public key.
|
static HDPath |
m(List<ChildNumber> list)
Returns a path for a private key.
|
static HDPath |
M(List<ChildNumber> list)
Returns a path for a public key.
|
static HDPath |
parsePath(String path)
Create an HDPath from a path string.
|
int |
size() |
String |
toString() |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArrayparallelStream, removeIf, streamprotected final boolean hasPrivateKey
protected final List<ChildNumber> unmodifiableList
public HDPath(boolean hasPrivateKey,
List<ChildNumber> list)
hasPrivateKey - Whether it is a path to a private key or notlist - List of children in the pathpublic HDPath(List<ChildNumber> list)
list - List of children in the pathpublic static HDPath M(List<ChildNumber> list)
list - List of children in the pathpublic static HDPath M()
public static HDPath M(ChildNumber childNumber)
childNumber - Single child in pathpublic static HDPath M(ChildNumber... children)
children - Children in the pathpublic static HDPath m(List<ChildNumber> list)
list - List of children in the pathpublic static HDPath m()
public static HDPath m(ChildNumber childNumber)
childNumber - Single child in pathpublic static HDPath m(ChildNumber... children)
children - Children in the pathpublic static HDPath parsePath(@Nonnull String path)
"44H / 0H / 0H / 1 / 1"
Where a letter "H" means hardened key. Spaces are ignored.
public boolean hasPrivateKey()
public HDPath extend(ChildNumber child1, ChildNumber... children)
child1 - the first child to appendchildren - zero or more additional children to appendpublic HDPath extend(HDPath path2)
path2 - the relative path to appendpublic HDPath extend(List<ChildNumber> path2)
path2 - the relative path to appendpublic ChildNumber get(int index)
get in interface List<ChildNumber>get in class AbstractList<ChildNumber>public int size()
size in interface Collection<ChildNumber>size in interface List<ChildNumber>size in class AbstractCollection<ChildNumber>public String toString()
toString in class AbstractCollection<ChildNumber>Copyright © 2022 IoTeX Group. All rights reserved.