Class: AdderTree
- Inherits:
-
AdderTreeNode
- Object
- AdderTreeNode
- AdderTree
- Defined in:
- lib/javaclass/adder_tree.rb
Overview
The root node of the adder tree. The “adder tree” is a simple add-only tree. Once the tree is build it can’t be changed. Only new elements can be added. The tree’s main functionality is defined in AdderTreeNode.
- Author
-
Peter Kofler
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(data) ⇒ AdderTree
constructor
A new instance of AdderTree.
- #level ⇒ Object
- #root ⇒ Object
Methods inherited from AdderTreeNode
#add, #children, #contain?, #debug_print, #levels, #size, #to_a
Constructor Details
#initialize(data) ⇒ AdderTree
Returns a new instance of AdderTree.
80 81 82 |
# File 'lib/javaclass/adder_tree.rb', line 80 def initialize(data) super(data, nil) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
78 79 80 |
# File 'lib/javaclass/adder_tree.rb', line 78 def data @data end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
77 78 79 |
# File 'lib/javaclass/adder_tree.rb', line 77 def parent @parent end |