RingBufferUtils<T extends Object> class
Fixed-capacity ring buffer. When full, oldest is overwritten.
Constructors
- RingBufferUtils(int capacity)
-
Creates a ring buffer holding at most
capacityelements. Throws an ArgumentError ifcapacityis less than 1. Audited: 2026-06-12 11:26 EDTfactory
Properties
- capacity → int
-
Maximum number of elements; when full, oldest is overwritten.
Audited: 2026-06-12 11:26 EDT
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
True when the buffer has no elements.
Audited: 2026-06-12 11:26 EDT
no setter
- isNotEmpty → bool
-
True when the buffer has at least one element.
Audited: 2026-06-12 11:26 EDT
no setter
- length → int
-
Current number of elements (0 to capacity).
Audited: 2026-06-12 11:26 EDT
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
T value) → void -
Appends
value; overwrites oldest if at capacity. Audited: 2026-06-12 11:26 EDT -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeFirst(
) → T? - Removes and returns the oldest element, or null when the buffer is empty. Audited: 2026-06-12 11:26 EDT
-
toList(
) → List< T> - Elements in order (oldest first). 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