Skip to content

LeafList ​

LeafList 高性能元素列表类。

可以通过 innerId 快速查找到元素。

关键属性 ​

list: ILeaf[] ​

实际的元素列表。

keys: INumberMap ​

索引对象,通过 innerId 索引元素。

只读属性 ​

length: number ​

元素的个数。

关键方法 ​

has ( leaf: ILeaf): boolean ​

检测是否存在某个元素。

add ( leaf: ILeaf) ​

添加一个元素。

addAt ( leaf: ILeaf, index: number) ​

添加一个元素到指定位置。

addList ( list: ILeaf[]) ​

添加一组元素。

remove ( leaf: ILeaf) ​

移除元素。

indexAt ( index: number):ILeaf ​

获取指定位置的元素。

indexOf ( leaf: ILeaf): number ​

获取元素的位置。

forEach ( itemCallback: IFunction) ​

遍历元素。

clone ( ): LeafList ​

克隆一个 LeafList 对象。

update ( ) ​

更新元素索引。

reset ( ) ​

重置列表。

destroy ( ) ​

销毁列表。

API ​

LeafList ​

Released under the MIT License.