Class: Immutable::SortedSet::AVLNode::Empty
- Inherits:
-
Object
- Object
- Immutable::SortedSet::AVLNode::Empty
- Defined in:
- lib/immutable/sorted_set.rb
Direct Known Subclasses
Instance Method Summary collapse
- #at(index) ⇒ Object
- #between(from, to) ⇒ Object
- #bulk_delete(items) ⇒ Object
- #bulk_insert(items) ⇒ Object
- #delete(item) ⇒ Object
- #drop(n) ⇒ Object
- #each ⇒ Object
- #each_between(item, inclusive) ⇒ Object
- #each_greater(item, inclusive) ⇒ Object
- #each_less(item, inclusive) ⇒ Object
- #empty? ⇒ Boolean
- #height ⇒ Object
- #include?(item) ⇒ Boolean
-
#initialize(comparator) ⇒ Empty
constructor
A new instance of Empty.
- #insert(item) ⇒ Object
- #keep_only(items) ⇒ Object
- #left ⇒ Object
- #max ⇒ Object
- #min ⇒ Object
- #natural_order? ⇒ Boolean
- #prefix(item, inclusive) ⇒ Object
- #reverse_each ⇒ Object
- #right ⇒ Object
- #size ⇒ Object
- #slice(from, length) ⇒ Object
- #suffix(item, inclusive) ⇒ Object
- #take(n) ⇒ Object
Constructor Details
#initialize(comparator) ⇒ Empty
Returns a new instance of Empty.
1390 |
# File 'lib/immutable/sorted_set.rb', line 1390 def initialize(comparator); @comparator = comparator; end |
Instance Method Details
#at(index) ⇒ Object
1400 |
# File 'lib/immutable/sorted_set.rb', line 1400 def at(index); nil; end |
#between(from, to) ⇒ Object
1416 |
# File 'lib/immutable/sorted_set.rb', line 1416 def between(from, to); self; end |
#bulk_delete(items) ⇒ Object
1410 |
# File 'lib/immutable/sorted_set.rb', line 1410 def bulk_delete(items); self; end |
#bulk_insert(items) ⇒ Object
1404 1405 1406 1407 1408 1409 |
# File 'lib/immutable/sorted_set.rb', line 1404 def bulk_insert(items) items = items.to_a if !items.is_a?(Array) items = items.sort(&@comparator) SortedSet.uniq_by_comparator!(items, @comparator) AVLNode.from_items(items, @comparator) end |
#delete(item) ⇒ Object
1412 |
# File 'lib/immutable/sorted_set.rb', line 1412 def delete(item); throw :not_present; end |
#drop(n) ⇒ Object
1420 |
# File 'lib/immutable/sorted_set.rb', line 1420 def drop(n); self; end |
#each ⇒ Object
1398 |
# File 'lib/immutable/sorted_set.rb', line 1398 def each; end |
#each_between(item, inclusive) ⇒ Object
1419 |
# File 'lib/immutable/sorted_set.rb', line 1419 def each_between(item, inclusive); end |
#each_greater(item, inclusive) ⇒ Object
1417 |
# File 'lib/immutable/sorted_set.rb', line 1417 def each_greater(item, inclusive); end |
#each_less(item, inclusive) ⇒ Object
1418 |
# File 'lib/immutable/sorted_set.rb', line 1418 def each_less(item, inclusive); end |
#empty? ⇒ Boolean
1422 |
# File 'lib/immutable/sorted_set.rb', line 1422 def empty?; true; end |
#height ⇒ Object
1394 |
# File 'lib/immutable/sorted_set.rb', line 1394 def height; 0; end |
#include?(item) ⇒ Boolean
1413 |
# File 'lib/immutable/sorted_set.rb', line 1413 def include?(item); false; end |
#insert(item) ⇒ Object
1401 1402 1403 |
# File 'lib/immutable/sorted_set.rb', line 1401 def insert(item) AVLNode.new(item, @comparator, self, self) end |
#keep_only(items) ⇒ Object
1411 |
# File 'lib/immutable/sorted_set.rb', line 1411 def keep_only(items); self; end |
#left ⇒ Object
1392 |
# File 'lib/immutable/sorted_set.rb', line 1392 def left; self; end |
#max ⇒ Object
1397 |
# File 'lib/immutable/sorted_set.rb', line 1397 def max; nil; end |
#min ⇒ Object
1396 |
# File 'lib/immutable/sorted_set.rb', line 1396 def min; nil; end |
#natural_order? ⇒ Boolean
1391 |
# File 'lib/immutable/sorted_set.rb', line 1391 def natural_order?; false; end |
#prefix(item, inclusive) ⇒ Object
1414 |
# File 'lib/immutable/sorted_set.rb', line 1414 def prefix(item, inclusive); self; end |
#reverse_each ⇒ Object
1399 |
# File 'lib/immutable/sorted_set.rb', line 1399 def reverse_each; end |
#right ⇒ Object
1393 |
# File 'lib/immutable/sorted_set.rb', line 1393 def right; self; end |
#size ⇒ Object
1395 |
# File 'lib/immutable/sorted_set.rb', line 1395 def size; 0; end |
#slice(from, length) ⇒ Object
1423 |
# File 'lib/immutable/sorted_set.rb', line 1423 def slice(from, length); self; end |
#suffix(item, inclusive) ⇒ Object
1415 |
# File 'lib/immutable/sorted_set.rb', line 1415 def suffix(item, inclusive); self; end |
#take(n) ⇒ Object
1421 |
# File 'lib/immutable/sorted_set.rb', line 1421 def take(n); self; end |