CircularQueue
The CircularQueue
provides a circular queue that can be used to store the latest 'cap' elements.
Value parameters
- cap
-
the capacity or maximum number of elements that can be stored
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Add element 'elem' to the front of 'this' circular queue, overwriting the oldest element when queue is full.
Add element 'elem' to the front of 'this' circular queue, overwriting the oldest element when queue is full.
Value parameters
- elem
-
the element to add
Attributes
Remove the oldest element from the rear of 'this' circular queue, throwing an exception when the queue is empty
Remove the oldest element from the rear of 'this' circular queue, throwing an exception when the queue is empty
Attributes
Remove the oldest element from the rear of 'this' circular queue, returning null when the queue is empty.
Remove the oldest element from the rear of 'this' circular queue, returning null when the queue is empty.
Attributes
Add element 'elem' to the front of 'this' circular queue, throwing an exeception when the queue is full.
Add element 'elem' to the front of 'this' circular queue, throwing an exeception when the queue is full.
Value parameters
- elem
-
the element to add
Attributes
Return whether the queue is empty (i.e., has no element).
Return whether the queue is empty (i.e., has no element).
Attributes
Return whether the queue is full (i.e., no space left for new elements).
Return whether the queue is full (i.e., no space left for new elements).
Attributes
Return the current size of the queue (number of elements contained).
Return the current size of the queue (number of elements contained).
Attributes
Convert 'this' circular queue into a string. FIX - also print empty slot
Convert 'this' circular queue into a string. FIX - also print empty slot
Attributes
- Definition Classes
-
Any