Constructor and Description |
---|
TreeEntryNode(LinkedForestMap.TreeEntryNode<K,V> parent,
K key)
创建一个节点
|
TreeEntryNode(LinkedForestMap.TreeEntryNode<K,V> parent,
K key,
V value)
创建一个节点
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
比较目标对象与当前
TreeEntry 是否相等。 |
boolean |
equalsKey(K key)
指定key与当前节点的key是否相等
|
void |
forEachChild(boolean includeSelf,
Consumer<TreeEntry<K,V>> nodeConsumer)
获取以当前节点作为根节点的树结构,然后遍历所有节点
|
LinkedForestMap.TreeEntryNode<K,V> |
getChild(K key)
获取以当前节点作为根节点的树结构,然后获取该树结构中的当前节点的指定子节点
|
Map<K,TreeEntry<K,V>> |
getChildren()
获取以当前节点作为根节点的树结构,然后按广度优先获取该树结构中的当前节点的全部子节点
|
Map<K,TreeEntry<K,V>> |
getDeclaredChildren()
获取当前节点直接关联的子节点
|
LinkedForestMap.TreeEntryNode<K,V> |
getDeclaredParent()
获取当前节点直接关联的父节点
|
K |
getKey()
获取当前节点的key
|
LinkedForestMap.TreeEntryNode<K,V> |
getParent(K key)
获取以当前节点作为叶子节点的树结构,然后获取该树结构中当前节点的指定父节点
|
LinkedForestMap.TreeEntryNode<K,V> |
getRoot()
获取以当前节点作为叶子节点的树结构,然后获取该树结构的根节点
|
V |
getValue()
获取节点的value
|
int |
getWeight()
获取当前节点与根节点的距离
|
int |
hashCode()
返回当前
TreeEntry 的哈希值。 |
boolean |
isRoot()
当前节点是否为根节点
|
V |
setValue(V value)
设置节点的value
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
containsChild, containsParent, hasChildren, hasParent
comparingByKey, comparingByKey, comparingByValue, comparingByValue
public TreeEntryNode(LinkedForestMap.TreeEntryNode<K,V> parent, K key)
parent
- 节点的父节点key
- 节点的keypublic TreeEntryNode(LinkedForestMap.TreeEntryNode<K,V> parent, K key, V value)
parent
- 节点的父节点key
- 节点的keyvalue
- 节点的valuepublic K getKey()
public int getWeight()
public V getValue()
public boolean isRoot()
public LinkedForestMap.TreeEntryNode<K,V> getRoot()
public LinkedForestMap.TreeEntryNode<K,V> getDeclaredParent()
getDeclaredParent
in interface TreeEntry<K,V>
public LinkedForestMap.TreeEntryNode<K,V> getParent(K key)
public void forEachChild(boolean includeSelf, Consumer<TreeEntry<K,V>> nodeConsumer)
forEachChild
in interface TreeEntry<K,V>
includeSelf
- 是否处理当前节点nodeConsumer
- 对节点的处理public boolean equalsKey(K key)
key
- 要比较的keypublic LinkedForestMap.TreeEntryNode<K,V> getChild(K key)
public Map<K,TreeEntry<K,V>> getDeclaredChildren()
getDeclaredChildren
in interface TreeEntry<K,V>
public Map<K,TreeEntry<K,V>> getChildren()
getChildren
in interface TreeEntry<K,V>
public boolean equals(Object o)
Copyright © 2024. All rights reserved.