class Quartz::HeapSet(T)
- Quartz::HeapSet(T)
- Quartz::PriorityQueue(T)
- Reference
- Object
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.crConstructors
- .new(initial_capacity : Int, &comparator : Duration, Duration, Bool -> Int32)
- .new(&comparator : Duration, Duration, Bool -> Int32)
Instance Method Summary
-
#==(other) : Bool
Returns
false
(other can only be aValue
here). - #==(other : HeapSet) : Bool
- #clear
- #delete(priority : Duration, event : T) : T?
- #empty? : Bool
- #heapify!
- #inspect(io)
- #next_priority : Duration
- #next_priority(&)
- #peek : T
- #peek(&)
- #peek? : T?
- #pop : T
- #pop_imminents(&)
- #push(priority : Duration, value : T) : self
-
#size : Int32
Returns the number of elements in the heap.
- #to_a : Array(Tuple(Duration, Set(T)))
- #to_slice : Slice(Tuple(Duration, Set(T)))
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) : selfnew(&) new
Instance methods inherited from class Reference
==(other : Quartz::Any)
==
Instance methods inherited from class Object
===(other : Quartz::Any)
===
Constructor Detail
Instance Method Detail
def ==(other) : Bool
#
Description copied from class Reference
Returns false
(other can only be a Value
here).