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

PriorityMapUtils()

Properties

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
True when no items remain. Audited: 2026-06-12 11:26 EDT
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(K priority, V value) → void
Enqueues value under priority, 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