Class: IntervalSkipList::HeadNode

Inherits:
Object
  • Object
show all
Defined in:
lib/treetop/runtime/interval_skip_list/head_node.rb

Direct Known Subclasses

Node

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(height) ⇒ HeadNode

Returns a new instance of HeadNode


5
6
7
8
9
# File 'lib/treetop/runtime/interval_skip_list/head_node.rb', line 5

def initialize(height)
  @height = height
  @forward = Array.new(height, nil)
  @forward_markers = Array.new(height) {|i| []}
end

Instance Attribute Details

#forwardObject (readonly)

Returns the value of attribute forward


3
4
5
# File 'lib/treetop/runtime/interval_skip_list/head_node.rb', line 3

def forward
  @forward
end

#forward_markersObject (readonly)

Returns the value of attribute forward_markers


3
4
5
# File 'lib/treetop/runtime/interval_skip_list/head_node.rb', line 3

def forward_markers
  @forward_markers
end

#heightObject (readonly)

Returns the value of attribute height


3
4
5
# File 'lib/treetop/runtime/interval_skip_list/head_node.rb', line 3

def height
  @height
end

Instance Method Details

#top_levelObject


11
12
13
# File 'lib/treetop/runtime/interval_skip_list/head_node.rb', line 11

def top_level
  height - 1
end