Class: StrokeDB::InvertedList::Node
- Defined in:
- lib/strokedb/data_structures/inverted_list.rb
Instance Attribute Summary collapse
-
#_serialized_index ⇒ Object
Returns the value of attribute _serialized_index.
-
#forward ⇒ Object
Returns the value of attribute forward.
-
#key ⇒ Object
Returns the value of attribute key.
-
#values ⇒ Object
Returns the value of attribute values.
Instance Method Summary collapse
- #<(key) ⇒ Object
- #<=(key) ⇒ Object
-
#free(list) ⇒ Object
this is called when node is thrown out of the list note, that node.value is called immediately after node.free.
-
#initialize(level, key, value) ⇒ Node
constructor
A new instance of Node.
-
#level ⇒ Object
do nothing.
- #next ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#_serialized_index ⇒ Object
Returns the value of attribute _serialized_index.
215 216 217 |
# File 'lib/strokedb/data_structures/inverted_list.rb', line 215 def _serialized_index @_serialized_index end |
#forward ⇒ Object
Returns the value of attribute forward.
214 215 216 |
# File 'lib/strokedb/data_structures/inverted_list.rb', line 214 def forward @forward end |
#key ⇒ Object
Returns the value of attribute key.
214 215 216 |
# File 'lib/strokedb/data_structures/inverted_list.rb', line 214 def key @key end |
#values ⇒ Object
Returns the value of attribute values.
214 215 216 |
# File 'lib/strokedb/data_structures/inverted_list.rb', line 214 def values @values end |
Instance Method Details
#<(key) ⇒ Object
228 229 230 |
# File 'lib/strokedb/data_structures/inverted_list.rb', line 228 def <(key) @key < key end |
#<=(key) ⇒ Object
231 232 233 |
# File 'lib/strokedb/data_structures/inverted_list.rb', line 231 def <=(key) @key <= key end |
#free(list) ⇒ Object
this is called when node is thrown out of the list note, that node.value is called immediately after node.free
222 223 224 |
# File 'lib/strokedb/data_structures/inverted_list.rb', line 222 def free(list) # do nothing end |
#level ⇒ Object
do nothing
225 226 227 |
# File 'lib/strokedb/data_structures/inverted_list.rb', line 225 def level @forward.size end |
#next ⇒ Object
234 235 236 |
# File 'lib/strokedb/data_structures/inverted_list.rb', line 234 def next forward[0] end |
#to_s ⇒ Object
237 238 239 |
# File 'lib/strokedb/data_structures/inverted_list.rb', line 237 def to_s "[#{level}]#{@key}: #{@values.inspect}" end |