class SyntaxSuggest::PriorityEngulfQueue

Keeps track of what elements are in the queue in priority and also ensures that when one element engulfs/covers/eats another that the larger element evicts the smaller element

Public Class Methods

new ()
# File lib/syntax_suggest/priority_engulf_queue.rb, line 9
def initialize
  @queue = PriorityQueue.new
end

Public Instance Methods

empty? ()
# File lib/syntax_suggest/priority_engulf_queue.rb, line 17
def empty?
  @queue.empty?
end
length ()
# File lib/syntax_suggest/priority_engulf_queue.rb, line 21
def length
  @queue.length
end
peek ()
# File lib/syntax_suggest/priority_engulf_queue.rb, line 25
def peek
  @queue.peek
end
pop ()
# File lib/syntax_suggest/priority_engulf_queue.rb, line 29
def pop
  @queue.pop
end
push (block)
# File lib/syntax_suggest/priority_engulf_queue.rb, line 33
def push(block)
  prune_engulf(block)
  @queue << block
  flush_deleted

  self
end
to_a ()
# File lib/syntax_suggest/priority_engulf_queue.rb, line 13
def to_a
  @queue.to_a
end