T
- Generic type of thispublic class Queue1L<T> extends QueueSecondary<T>
Constructor and Description |
---|
Queue1L() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Resets
this to its initial value. |
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 . |
java.util.Iterator<T> |
iterator() |
int |
length()
Reports the number of entries in the queue.
|
Queue<T> |
newInstance()
Returns a new object with the same dynamic type as
this , having
an initial value. |
T |
replaceFront(T entry)
Replaces the entry at the front of
this with entry , and
returns the entry at the front of #this . |
void |
transferFrom(Queue<T> source)
Sets
this to the incoming value of source, and resets
source to an initial value; the declaration notwithstanding, the
dynamic type of source must be the same as the dynamic type of
this . |
public void enqueue(T entry)
QueueKernel
entry
to the back of this
.entry
- entry to be enqueuedpublic T dequeue()
QueueKernel
this
.public int length()
QueueKernel
public T front()
QueueKernel
this
.this
public T replaceFront(T entry)
QueueKernel
this
with entry
, and
returns the entry at the front of #this
.entry
- new front of the queuepublic void clear()
Standard
this
to its initial value.public void transferFrom(Queue<T> source)
Standard
this
to the incoming value of source, and resets
source
to an initial value; the declaration notwithstanding, the
dynamic type of source
must be the same as the dynamic type of
this
. If the type T has a no-argument constructor, then
source
satisfies the contract of the no-argument constructor for
T. If T does not have a no-argument constructor, then source satisfies
the contract of the constructor call that was used to initialize
#source
.source
- object whose value is to be transferredpublic Queue<T> newInstance()
Standard
this
, having
an initial value. If the type T has a no-argument constructor, then the
value of the new returned object satisfies the contract of the
no-argument constructor for T. If T does not have a no-argument
constructor, then the value of the new returned object satisfies the
contract of the constructor call that was used to initialize
this
.this
with an initial valuepublic java.util.Iterator<T> iterator()