GenericQueue class final
A queue that preserves the generic type of each enqueued item.
Items are grouped into per-type sub-queues. When dequeued, the GenericQueueHandler receives the item along with its original generic type, allowing type-safe processing without losing generic information.
Constructors
- GenericQueue({required GenericQueueHandler handler})
-
Creates a new GenericQueue with the given
handler.
Properties
- handler → GenericQueueHandler
-
The handler invoked when an item is dequeued.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isNotEmpty → bool
-
Whether the queue contains any items.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void - Removes all items from the queue.
-
dequeue(
) → void - Dequeues and processes the most recently enqueued item.
-
enqueue<
TItem extends Object> (TItem value) → void -
Enqueues a
valueat the front of the queue (LIFO relative to dequeue). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pop(
) → void - Pops and processes the earliest enqueued item.
-
push<
TItem extends Object> (TItem value) → void -
Pushes a
valueto the back of the queue. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited