PriorityMapUtils<K extends Object, V extends Object> class
Buckets values by a priority key, draining buckets in the order each priority was FIRST added (insertion order), and FIFO within a bucket.
IMPORTANT: this does NOT order buckets by comparing the K priority value —
K is not constrained to Comparable, so removeFirst returns the
first-inserted priority bucket, not the numerically lowest. Adding priority
2 before priority 1 drains 2 first. For value-ordered priority,
pre-sort additions by priority, or use a structure backed by a
SplayTreeMap/heap with a Comparable key.
Constructors
Properties
Methods
-
add(
K priority, V value) → void -
Enqueues
valueunderpriority, creating the bucket if needed. Audited: 2026-06-12 11:26 EDT -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeFirst(
) → V? - Removes and returns the next item: FIFO from the first-added priority bucket (NOT the lowest priority value — see the class doc), or null when the map is empty. Emptied buckets are pruned. Audited: 2026-06-12 11:26 EDT
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited