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.



9
10
11
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 9

def next_level
  @next_level
end

Instance Method Details

#<=>(other) ⇒ Object

A sentinal node is always greater than any other node



32
33
34
35
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 32

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

#finished?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 23

def finished?
  true
end

#leaf?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 15

def leaf?
  true
end

#nextObject



19
20
21
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 19

def next
  nil
end

#sentinel?Boolean

Returns:

  • (Boolean)


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

def sentinel?
  true
end

#valueObject



27
28
29
# File 'lib/flat_kit/sentinel_leaf_node.rb', line 27

def value
  nil
end