
com.alachisoft.ncache.client.datastructures.DistributedQueue Maven / Gradle / Ivy
package com.alachisoft.ncache.client.datastructures;
import java.util.Queue;
/**
* This interface contains methods and parameters for distrubited Queue.
* @param The type of elements in the Queue.
*/
public interface DistributedQueue extends Queue, DistributedDataStructure, Notifiable {
/**
* Removes all of the elements from this collection (optional operation).
* The collection will be empty after this method returns.
*
* @throws UnsupportedOperationException if the {@code clear} operation
* is not supported by this collection
*/
void clear();
/**
* Copies the Queue elements to the specified array, starting at the specified index.
* @param array The destination array of the elements copied from Queue.
* @param arrayIndex he zero-based index in array at which copying begins.
*/
void copyTo(T[] array, int arrayIndex);
/**
* Retrieves, but does not remove, the head of this queue,
* or returns {@code null} if this queue is empty.
*
* @return the head of this queue, or {@code null} if this queue is empty
*/
T peek();
/**
* Returns an array containing all of the elements in this collection.
* If this collection makes any guarantees as to what order its elements
* are returned by its iterator, this method must return the elements in
* the same order.
*
* The returned array will be "safe" in that no references to it are
* maintained by this collection. (In other words, this method must
* allocate a new array even if this collection is backed by an array).
* The caller is thus free to modify the returned array.
*
*
This method acts as bridge between array-based and collection-based
* APIs.
*
* @return an array containing all of the elements in this collection
*/
Object[] toArray();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy