Class: FlatKit::SentinelLeafNode

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/flat_kit/sentinel_leaf_node.rb

Overview

Private: The Sentinel Leaf Node is used internally by the MergeTree

This class represents a LeafNode that has no more data

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#next_levelObject

Returns the value of attribute next_level.



11
12
13
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 11

def next_level
  @next_level
end

Instance Method Details

#<=>(other) ⇒ Object

A sentinal node is always greater than any other node



34
35
36
37
38
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 34

def <=>(other)
  return 0 if other.sentinel?

  1
end

#finished?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 25

def finished?
  true
end

#leaf?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 17

def leaf?
  true
end

#nextObject



21
22
23
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 21

def next
  nil
end

#sentinel?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 13

def sentinel?
  true
end

#valueObject



29
30
31
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 29

def value
  nil
end