Collections.AsLifoQueue(IDeque) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a view of a Deque as a Last-in-first-out (Lifo)
Queue.
[Android.Runtime.Register("asLifoQueue", "(Ljava/util/Deque;)Ljava/util/Queue;", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.IQueue AsLifoQueue(Java.Util.IDeque deque);
[<Android.Runtime.Register("asLifoQueue", "(Ljava/util/Deque;)Ljava/util/Queue;", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member AsLifoQueue : Java.Util.IDeque -> Java.Util.IQueue
Parameters
- deque
- IDeque
the deque
Returns
the queue
- Attributes
Remarks
Returns a view of a Deque as a Last-in-first-out (Lifo) Queue. Method add is mapped to push, remove is mapped to pop and so on. This view can be useful when you would like to use a method requiring a Queue but you need Lifo ordering.
Each method invocation on the queue returned by this method results in exactly one method invocation on the backing deque, with one exception. The Queue#addAll addAll method is implemented as a sequence of Deque#addFirst addFirst invocations on the backing deque.
Added in 1.6.
Java documentation for java.util.Collections.asLifoQueue(java.util.Deque<T>).
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.