class Quartz::HeapSet(T)

Overview

Event set based on a array-based min-heap similar to BinaryHeap, but optimized for higher event collision rate.

Instead of adding all events in the heap, simultaneous events are gathered and as a set in the heap.

To avoid O(n) complexity when deleting an arbitrary element, a map is used to store indices for each event in the event set.

Defined in:

quartz/priority_queues/heap_set.cr

Constructors

Instance Method Summary

Instance methods inherited from class Quartz::PriorityQueue(T)

clear clear, delete(priority : Duration, value : T) : T? delete, empty? : Bool empty?, next_priority : Duration next_priority, peek : T peek, peek? : T? peek?, pop : T pop, pop_imminents(&) pop_imminents, push(priority : Duration, value : T) push, size : Int size

Constructor methods inherited from class Quartz::PriorityQueue(T)

new(priority_queue : Symbol, &comparator : Duration, Duration, Bool -> Int32) : self
new(&)
new

Instance methods inherited from class Reference

==(other : Quartz::Any) ==

Instance methods inherited from class Object

===(other : Quartz::Any) ===

Constructor Detail

def self.new(initial_capacity : Int, &comparator : Duration, Duration, Bool -> Int32) #

[View source]
def self.new(&comparator : Duration, Duration, Bool -> Int32) #

[View source]

Instance Method Detail

def ==(other) : Bool #
Description copied from class Reference

Returns false (other can only be a Value here).


[View source]
def ==(other : HeapSet) : Bool #

[View source]
def clear #

[View source]
def delete(priority : Duration, event : T) : T? #

[View source]
def empty? : Bool #

[View source]
def heapify! #

[View source]
def inspect(io) #

[View source]
def next_priority : Duration #

[View source]
def next_priority(&) #

[View source]
def peek : T #

[View source]
def peek(&) #

[View source]
def peek? : T? #

[View source]
def pop : T #

[View source]
def pop_imminents(&) #

[View source]
def push(priority : Duration, value : T) : self #

[View source]
def size : Int32 #

Returns the number of elements in the heap.


[View source]
def to_a : Array(Tuple(Duration, Set(T))) #

[View source]
def to_slice : Slice(Tuple(Duration, Set(T))) #

[View source]