BinaryNode class

Constructors

BinaryNode(BinaryNode? parent, TreeData props, TreeMapNode layoutNode, {int deep = 0, int maxDeep = -1, num value = 0})

Properties

childCount int
no setterinherited
childIndex int
自身在父节点中的索引 如果为-1表示没有父节点
no setterinherited
children List<BinaryNode>
no setterinherited
childrenReverse List<BinaryNode>
no setterinherited
count int
返回后代节点数 调用该方法前必须先调用 computeCount,否则永远返回0
no setterinherited
deep int
no setterinherited
expand bool
getter/setter pairinherited
firstChild BinaryNode
no setterinherited
hasChild bool
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
height int
no setterinherited
isLeaf bool
no setterinherited
lastChild BinaryNode
no setterinherited
layoutNode TreeMapNode
final
left BinaryNode?
getter/setter pair
maxDeep int
整颗树最大的深度
getter/setter pairinherited
notChild bool
no setterinherited
parent BinaryNode?
getter/setter pairinherited
position Rect
getter/setter pair
props → TreeData
final
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
select bool
getter/setter pairinherited
size Size
保存节点大小和位置
getter/setter pairinherited
value double
getter/setter pairinherited
x num
getter/setter pairinherited
y num
getter/setter pairinherited

Methods

add(BinaryNode node) → void
inherited
ancestors() List<BinaryNode>
返回从当前节点开始的祖先节点
inherited
bottom2Top() → void
inherited
childAt(int index) BinaryNode
inherited
clear() → void
inherited
computeCount() int
计算当前节点的后代节点数
inherited
computeDeep(BinaryNode node, [int initDeep = 0]) → void
inherited
computeHeight(BinaryNode node, [int initHeight = 0]) → void
计算树的高度
inherited
copy(BinaryNode build(BinaryNode?, BinaryNode), [int deep = 0]) BinaryNode
从复制当前节点及其后代 复制后的节点没有parent
inherited
depthNode(int depth, [bool only = true]) List<BinaryNode>
从当前节点开始查找深度等于给定深度的节点 广度优先遍历 only==true 只返回对应层次的,否则返回<=
inherited
descendants() List<BinaryNode>
返回其所有后代节点
inherited
each(TreeFun<BinaryNode> callback) BinaryNode
inherited
eachAfter(TreeFun<BinaryNode> callback) BinaryNode
后序遍历
inherited
eachBefore(TreeFun<BinaryNode> callback) BinaryNode
先序遍历
inherited
find(TreeFun<BinaryNode> callback) BinaryNode?
在子节点中查找对应节点
inherited
findMaxDeep() int
inherited
getBoundBox() Rect
inherited
iterator() List<BinaryNode>
返回其后代所有节点(按照拓扑结构)
inherited
leafLeft() BinaryNode
返回当前节点下最左边的叶子节点
inherited
leafRight() BinaryNode
inherited
leaves() List<BinaryNode>
返回其所有的叶子结点
inherited
返回当前节点的后续的所有Link
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
path(BinaryNode target) List<BinaryNode>
返回从当前节点到指定节点的最短路径
inherited
remove(BinaryNode node) → void
inherited
removeAt(int i) BinaryNode
inherited
removeChild(bool filter(BinaryNode)) → void
inherited
removeFirst() BinaryNode
inherited
removeLast() BinaryNode
inherited
removeWhere(bool where(BinaryNode), [bool iterator = false]) → void
inherited
resetDeep(int deep, [bool iterator = true]) → void
重新设置深度
inherited
right2Left() → void
inherited
setExpand(bool e, [bool iterator = true]) → void
inherited
sort(int compare(BinaryNode, BinaryNode), [bool iterator = true]) BinaryNode
inherited
sum([num valueCallback(BinaryNode)?]) BinaryNode
计算当前节点值 如果给定了回调,那么将使用给定的回调进行值统计 否则直接使用 _value 统计
inherited
toString() String
A string representation of this object.
inherited
translate(num dx, num dy) → void
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited