Recommend this page to a friend! |
Classes of Thomas Björk | JavaScript Tree Linked List | README.md | Download |
|
|
DownloadTreeListTreeList is an implementation of a binaty tree combined with a double linked list. You can easily build an hierarchy of your objects or arrays on a specified index. Class TTreeListpropertiesrootThe root node of the tree firstThe first node of the double linked list lastThe last node of the double linked list treeCountThe number of nodes in the tree and double linked list isDirtySet if a node has been added since the last build functionsaddAdd a new node to the tree/double linked list countThe number of nodes in the raw tree (includes nodes with duplicate values) searchSearch for a node by value in the tree addBuildFilterAdd a filter callback that is called when the build function traverses all nodes before building the tree/list clearBuildFiltersRemove all build filters buildBuild a tree and a double linked list Class TTreeListNodepropertiesprevA pointer to the previous node in the double linked list leftA pointer to the left node in the tree parentA pointer to the parent node in the tree rightA pointer to the right node in the tree nextA pointer to the next node in the double linked list functionsaddPayloadAdd a node from the TTreeList. If the value is a duplicate then it is added as well getPayloadCountReturn the number of payloads this node holds setPayloadIndexSet the index for which payload should return a value with the get function getReturn the value of the given index from the active payload |