Java Reference
In-Depth Information
deque.Methodsareprovidedtoinsert,remove,andexaminetheelement.Eachofthese
methodsexistsintwoforms:onethrowsanexceptionwhentheoperationfails,theother
returnsaspecialvalue(eithernullorfalse,dependingontheoperation).Thelatterform
of the insert operation is designed specifically for use with capacity-restricted
Deque
implementations; in most implementations, insert operations cannot fail.
both forms of the insert, remove, and examine methods for both the head and the tail.
Figure 5-2.
Deque
declares twelve methods for inserting, removing, and examining
elements at the head or tail of a deque.