Class: Hamster::SortedSet::AVLNode::Empty

Inherits:
Object
  • Object
show all
Defined in:
lib/hamster/sorted_set.rb

Direct Known Subclasses

PlainAVLNode::Empty

Instance Method Summary collapse

Constructor Details

#initialize(comparator) ⇒ Empty

Returns a new instance of Empty.


1356
# File 'lib/hamster/sorted_set.rb', line 1356

def initialize(comparator); @comparator = comparator; end

Instance Method Details

#at(index) ⇒ Object


1366
# File 'lib/hamster/sorted_set.rb', line 1366

def at(index); nil; end

#between(from, to) ⇒ Object


1380
# File 'lib/hamster/sorted_set.rb', line 1380

def between(from, to);       self; end

#bulk_delete(items) ⇒ Object


1374
# File 'lib/hamster/sorted_set.rb', line 1374

def bulk_delete(items); self; end

#bulk_insert(items) ⇒ Object


1370
1371
1372
1373
# File 'lib/hamster/sorted_set.rb', line 1370

def bulk_insert(items)
  items = items.to_a if !items.is_a?(Array)
  AVLNode.from_items(items.sort(&@comparator), @comparator)
end

#delete(item) ⇒ Object


1376
# File 'lib/hamster/sorted_set.rb', line 1376

def delete(item);       throw :not_present; end

#drop(n) ⇒ Object


1384
# File 'lib/hamster/sorted_set.rb', line 1384

def drop(n);             self; end

#eachObject


1364
# File 'lib/hamster/sorted_set.rb', line 1364

def each;           end

#each_between(item, inclusive) ⇒ Object


1383
# File 'lib/hamster/sorted_set.rb', line 1383

def each_between(item, inclusive); end

#each_greater(item, inclusive) ⇒ Object


1381
# File 'lib/hamster/sorted_set.rb', line 1381

def each_greater(item, inclusive); end

#each_less(item, inclusive) ⇒ Object


1382
# File 'lib/hamster/sorted_set.rb', line 1382

def each_less(item, inclusive);    end

#empty?Boolean

Returns:

  • (Boolean)

1386
# File 'lib/hamster/sorted_set.rb', line 1386

def empty?;              true; end

#heightObject


1360
# File 'lib/hamster/sorted_set.rb', line 1360

def height;   0;    end

#include?(item) ⇒ Boolean

Returns:

  • (Boolean)

1377
# File 'lib/hamster/sorted_set.rb', line 1377

def include?(item);     false; end

#insert(item) ⇒ Object


1367
1368
1369
# File 'lib/hamster/sorted_set.rb', line 1367

def insert(item)
  AVLNode.new(item, @comparator, self, self)
end

#keep_only(items) ⇒ Object


1375
# File 'lib/hamster/sorted_set.rb', line 1375

def keep_only(items);   self; end

#leftObject


1358
# File 'lib/hamster/sorted_set.rb', line 1358

def left;  self;    end

#maxObject


1363
# File 'lib/hamster/sorted_set.rb', line 1363

def max;    nil;    end

#minObject


1362
# File 'lib/hamster/sorted_set.rb', line 1362

def min;    nil;    end

#natural_order?Boolean

Returns:

  • (Boolean)

1357
# File 'lib/hamster/sorted_set.rb', line 1357

def natural_order?; false; end

#prefix(item, inclusive) ⇒ Object


1378
# File 'lib/hamster/sorted_set.rb', line 1378

def prefix(item, inclusive); self; end

#reverse_eachObject


1365
# File 'lib/hamster/sorted_set.rb', line 1365

def reverse_each;   end

#rightObject


1359
# File 'lib/hamster/sorted_set.rb', line 1359

def right; self;    end

#sizeObject


1361
# File 'lib/hamster/sorted_set.rb', line 1361

def size;     0;    end

#slice(from, length) ⇒ Object


1387
# File 'lib/hamster/sorted_set.rb', line 1387

def slice(from, length); self; end

#suffix(item, inclusive) ⇒ Object


1379
# File 'lib/hamster/sorted_set.rb', line 1379

def suffix(item, inclusive); self; end

#take(n) ⇒ Object


1385
# File 'lib/hamster/sorted_set.rb', line 1385

def take(n);             self; end