Module Apotomo::TreeNode
In: lib/apotomo/widget/tree_node.rb

Methods

<=>   []   add_widget   children   each   find_by_path   path   printTree   remove!   root   root!   root?   setup_tree_node   size   to_s  

Included Modules

Enumerable Apotomo::WidgetShortcuts::DSL

Attributes

childrenHash  [R]  DISCUSS: do we need it? we have []! DISCUSS: children receives a block, but childrenHash doesn‘t
parent  [RW] 

Public Instance methods

Provides a comparision operation for the nodes. Comparision is based on the natural character-set ordering for the node names. DUISCUSS: useful? DUISCUSS: <, >, etc., operators doesn‘t work because of Comparable isn‘t included

Returns the requested node from the set of immediate children.

If the key is numeric, then the in-sequence array of children is accessed (see Tree#children). If the key is not numeric, then it is assumed to be the name of the child node to be returned.

Returns an array of all the immediate children. If a block is given, yields each child node to the block.

Returns every node (including the receiver node) from the tree to the specified block.

Returns the path from the widget to root, encoded as a string of slash-seperated names.

Pretty prints the tree starting with the receiver node.

Removes the specified child node from the receiver node. The removed children nodes are orphaned but available if an alternate reference exists. Returns the child node.

Returns the root for this node.

Indicates whether this node is a root node. Note that orphaned children will also be reported as root nodes.

Returns the total number of nodes in this tree, rooted at the receiver node.

Print the string representation of this node.

Protected Instance methods

Private method which sets this node as a root node.

[Validate]