

The simple trick of turning the array into a closed circle and letting the head and tail drift around endlessly in that circle makes it unnecessary to ever move items stored in the array. It can also be empty, at which point removing an element will be impossible until a new element has been added again.įixed-length arrays are limited in capacity, but it is not true that items need to be copied towards the head of the queue. Regardless of how many elements are already contained, a new element can always be added. Theoretically, one characteristic of a queue is that it does not have a specific capacity. In these contexts, the queue performs the function of a buffer.Īnother usage of queues is in the implementation of breadth-first search. Queues provide services in computer science, transport, and operations research where various entities such as data, objects, persons, or events are stored and held to be processed later. Common implementations are circular buffers and linked lists. Queues are common in computer programs, where they are implemented as data structures coupled with access routines, as an abstract data structure or in object-oriented languages as classes. A queue is an example of a linear data structure, or more abstractly a sequential collection. This is equivalent to the requirement that once a new element is added, all elements that were added before have to be removed before the new element can be removed. In a FIFO data structure, the first element added to the queue will be the first one to be removed. The operations of a queue make it a first-in-first-out (FIFO) data structure. Other operations may also be allowed, often including a peek or front operation that returns the value of the next element to be dequeued without dequeuing it. The operation of adding an element to the rear of the queue is known as enqueue, and the operation of removing an element from the front is known as dequeue. By convention, the end of the sequence at which elements are added is called the back, tail, or rear of the queue, and the end at which elements are removed is called the head or front of the queue, analogously to the words used when people line up to wait for goods or services. In computer science, a queue is a collection of entities that are maintained in a sequence and can be modified by the addition of entities at one end of the sequence and the removal of entities from the other end of the sequence.
Abstract queue java android#
Performs an Android runtime-checked type conversion.Representation of a FIFO (first in, first out) queue IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniIdentityHashCode(Int32) Some other thread interrupts the current thread, or a certain #notifyAll() method for this object, or a #notifyAll() method for this object.Ĭauses the current thread to wait until either another thread invokes the Returns a string representation of the object.Ĭauses the current thread to wait until another thread invokes the Returns a count of how many objects this Collection contains. Retrieves and removes the head of this queue. Retrieves and removes the head of this queue, Retrieves, but does not remove, the head of this queue, So immediately without violating capacity restrictions. Inserts the specified element into this queue if it is possible to do Wakes up all threads that are waiting on this object's monitor. Wakes up a single thread that is waiting on this object's Returns an iterator over the elements contained in this collection.Ĭalled by the garbage collector on an object when garbage collectionĭetermines that there are no more references to the object.
Abstract queue java code#
Returns a hash code value for the object. Indicates whether some other object is "equal to" this one. Retrieves, but does not remove, the head of this queue.

Abstract queue java for android#
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.Ĭreates and returns a copy of this object.

The handle to the underlying Android instance. Returns the runtime class of this Object. 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.ĪbstractQueue(IntPtr, JniHandleOwnership)Ī constructor used when creating managed representations of JNI objects called by the runtime. IJavaObject IJavaPeerable IIterable ICollection IQueue IDisposable Remarks
