Abstract supertype of datastructures that can be used as FIFO queues.
A Queue
has a well-defined front
and
back
. Elements may be added to the back
of the queue by offer()
, and removed from
the front of the queue by accept()
.
Note that many Queue
s are also List
s, but
there is no defined relationship between the
order of elements in the list and the direction
of the queue. In particular, the front of the
queue may be first element of the list, or it
may be the last element of the list.
LinkedList
, ArrayList
, Stack
no type hierarchy
no supertypes hierarchy
Attributes | |
back | Source Codeshared formal Element? back The element currently at the back of the
queue, or |
front | Source Codeshared formal Element? front The element currently at the front of the
queue, or |
Inherited Attributes |
Attributes inherited from: Object |
Methods | |
accept | Source Codeshared formal Element? accept() Remove and return the element at the front of the queue. |
offer | Source Codeshared formal void offer(Element element) Add a new element to the back of the queue. |
Inherited Methods |
Methods inherited from: Object |