Class: Immutable::SortedSet::PlainAVLNode::Empty

Inherits:
AVLNode::Empty show all
Defined in:
lib/immutable/sorted_set.rb

Instance Method Summary collapse

Methods inherited from AVLNode::Empty

#at, #between, #bulk_delete, #delete, #drop, #each, #each_between, #each_greater, #each_less, #empty?, #height, #include?, #keep_only, #left, #max, #min, #prefix, #reverse_each, #right, #size, #slice, #suffix, #take

Constructor Details

#initializeEmpty

Returns a new instance of Empty.



1479
# File 'lib/immutable/sorted_set.rb', line 1479

def initialize;           end

Instance Method Details

#bulk_insert(items) ⇒ Object



1484
1485
1486
1487
# File 'lib/immutable/sorted_set.rb', line 1484

def bulk_insert(items)
  items = items.to_a if !items.is_a?(Array)
  PlainAVLNode.from_items(items.uniq.sort!)
end

#insert(item) ⇒ Object



1481
1482
1483
# File 'lib/immutable/sorted_set.rb', line 1481

def insert(item)
  PlainAVLNode.new(item, self, self)
end

#natural_order?Boolean

Returns:

  • (Boolean)


1480
# File 'lib/immutable/sorted_set.rb', line 1480

def natural_order?; true; end