public interface QueueKernel<T> extends Standard<Queue<T>>
Queue
kernel component containing method headers and contracts for
all methods that will directly interact with the label representations of all
Queue implementations. All sub-interface methods should use only these
methods to perform operations on the Queue
.Modifier and Type | Method and Description |
---|---|
T |
dequeue()
Removes the entry at the front of
this . |
void |
enqueue(T entry)
Adds
entry to the back of this . |
T |
front()
Reports, but does not remove, the entry at the front of
this . |
int |
length()
Reports the number of entries in the queue.
|
T |
replaceFront(T entry)
Replaces the entry at the front of
this with entry , and
returns the entry at the front of #this . |
clear, newInstance, transferFrom
void enqueue(T entry)
entry
to the back of this
.entry
- entry to be enqueuedT dequeue()
this
.dequeue = [entry at the front of the queue] and [the front of the queue is removed]
int length()
T front()
this
.this
T replaceFront(T entry)
this
with entry
, and
returns the entry at the front of #this
.entry
- new front of the queue
replaceFront = #this.front and
this = (#this with the front of the queue swapped with entry
)