Interface DistributedQueue<T>
-
- Type Parameters:
T
- The type of elements in the Queue.
- All Superinterfaces:
java.util.Collection<T>
,DistributedDataStructure
,java.lang.Iterable<T>
,Lockable
,Notifiable
,java.util.Queue<T>
public interface DistributedQueue<T> extends java.util.Queue<T>, DistributedDataStructure, Notifiable
This interface contains methods and parameters for distrubited Queue.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Removes all of the elements from this collection (optional operation).void
copyTo(T[] array, int arrayIndex)
Copies the Queue elements to the specified array, starting at the specified index.T
peek()
Retrieves, but does not remove, the head of this queue, or returnsnull
if this queue is empty.java.lang.Object[]
toArray()
Returns an array containing all of the elements in this collection.-
Methods inherited from interface java.util.Collection
addAll, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
-
Methods inherited from interface com.alachisoft.ncache.client.datastructures.DistributedDataStructure
getKey, getWriteThruOptions, setWriteThruOptions
-
Methods inherited from interface com.alachisoft.ncache.client.datastructures.Notifiable
addChangeListener, removeChangeListener
-
-
-
-
Method Detail
-
clear
void clear()
Removes all of the elements from this collection (optional operation). The collection will be empty after this method returns.- Specified by:
clear
in interfacejava.util.Collection<T>
- Throws:
java.lang.UnsupportedOperationException
- if theclear
operation is not supported by this collection
-
copyTo
void copyTo(T[] array, int arrayIndex)
Copies the Queue elements to the specified array, starting at the specified index.- Parameters:
array
- The destination array of the elements copied from Queue.arrayIndex
- he zero-based index in array at which copying begins.
-
peek
T peek()
Retrieves, but does not remove, the head of this queue, or returnsnull
if this queue is empty.- Specified by:
peek
in interfacejava.util.Queue<T>
- Returns:
- the head of this queue, or
null
if this queue is empty
-
toArray
java.lang.Object[] toArray()
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.
- Specified by:
toArray
in interfacejava.util.Collection<T>
- Returns:
- an array containing all of the elements in this collection
-
-