ction.
Queue ― a collection used to hold multiple elements prior to processing. Besides basic
Collection operations, a
Queue provides additional insertion, extraction, and inspection operations.
Queues typically, but do not necessarily, order elements in a FIFO (first-in, first-out) manner. Among the exceptions are priority queues, which order elements according to a supplied comparator or the elements' natural ordering. Whatever the ordering used, the head of the queue is the element that would be removed by a call to remove or poll. In a FIFO queue, all new elements are inserted at the tail of the queue. Other kinds of queues may use different placement rules. Every Queue implementation must specify its ordering properties. Also see The Queue Interface section.
Deque ― a collection used to hold multiple elements prior to processing. Besides basic
Collection operations, a
Deque provides additional insertion, extraction, and inspection operations.
Deques can be used both as FIFO (first-in, first-out) and LIFO (last-in, first-out). In a deque all new elements can be inserted, retrieved and removed at both ends. Also see The Deque Interface section.
Map ― an object that maps keys to values. A
Map cannot contain duplicate keys; each key can map to at most one value. If you've used
Hashtable, you're already familiar with the basics of
Map. Also see The Map Interface section.
The last two core collection interfaces are merely sorted versions of Set and Map:
SortedSet ― a
Set that maintains its elements in ascending order. Several additional operations are provided to take advantage of the ordering. Sorted sets are used for naturally ordered sets, such as word lists and membership rolls. Also see The SortedSet Interface section.
SortedMap ― a
Map that maintains its mappings in ascending key order. This is the
Map analog of
SortedSet. Sorted maps are used for naturally ordered collections of key/value pairs, such as dictionaries and telephone directories. Also see The SortedMap Interface section.
To understand how the sorted interfaces maintain the order of their elements, see the Object Ordering section.