Interface NamedDeque<E>
- Type Parameters:
E- the type of values in the deque
- All Superinterfaces:
AutoCloseable,Collection<E>,Deque<E>,Iterable<E>,NamedCollection,NamedQueue<E>,ObservableCollection<E>,Queue<E>,Releasable,SequencedCollection<E>
- All Known Subinterfaces:
NamedBlockingDeque<E>
- All Known Implementing Classes:
NamedDequeProxy,com.tangosol.net.queue.WrapperNamedDeque
A
Deque based data-structure that manages values across one or
more processes. Values are typically managed in memory.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tangosol.net.NamedCollection
NamedCollection.Option -
Field Summary
Fields inherited from interface com.tangosol.net.NamedQueue
EXPIRY_DEFAULT, EXPIRY_NEVER -
Method Summary
Modifier and TypeMethodDescriptionvoidInserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions, throwing anIllegalStateExceptionif no space is currently available.voidInserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions, throwing anIllegalStateExceptionif no space is currently available.Return the Service that this NamedCollection is a part of.booleanofferFirst(E e, long cMillis) Inserts the specified element at the front of this deque unless it would violate capacity restrictions.booleanInserts the specified element at the end of this deque unless it would violate capacity restrictions.default longInsert an element to head of thisNamedDeque.longInsert an element to head of thisNamedDeque.voidPushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it is possible to do so immediately without violating capacity restrictions, throwing anIllegalStateExceptionif no space is currently available.Methods inherited from interface java.util.Collection
clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArrayMethods inherited from interface java.util.Deque
add, addAll, addFirst, addLast, contains, descendingIterator, element, getFirst, getLast, iterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, reversed, sizeMethods inherited from interface com.tangosol.net.NamedCollection
destroy, getName, isDestroyedMethods inherited from interface com.tangosol.net.NamedQueue
add, append, append, getQueueNameHash, getQueueStatistics, isActive, isReady, offerMethods inherited from interface com.tangosol.util.ObservableCollection
addListener, addListener, removeListener, removeListenerMethods inherited from interface com.tangosol.net.Releasable
close, isReleased, release
-
Method Details
-
getService
QueueService getService()Description copied from interface:NamedCollectionReturn the Service that this NamedCollection is a part of.- Specified by:
getServicein interfaceNamedCollection- Specified by:
getServicein interfaceNamedQueue<E>- Returns:
- the Service
-
prepend
Insert an element to head of thisNamedDeque.- Parameters:
e- the element to insert- Returns:
- the identifier for the inserted element, or
Long.MIN_VALUEif the element could not be inserted
-
prepend
Insert an element to head of thisNamedDeque.- Parameters:
e- the element to insertcMillis- the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; passNamedQueue.EXPIRY_DEFAULTto use the queue's default time-to-live setting; passNamedQueue.EXPIRY_NEVERto indicate that the queue entry should never expire; this milliseconds value is not a date/time value, such as is returned from System.currentTimeMillis()- Returns:
- the identifier for the inserted element, or
Long.MIN_VALUEif the element could not be inserted
-
addFirst
Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions, throwing anIllegalStateExceptionif no space is currently available. When using a capacity-restricted deque, it is generally preferable to use methodofferFirst(E, long).- Parameters:
e- the element to addcMillis- the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; passNamedQueue.EXPIRY_DEFAULTto use the queue's default time-to-live setting; passNamedQueue.EXPIRY_NEVERto indicate that the queue entry should never expire; this milliseconds value is not a date/time value, such as is returned from System.currentTimeMillis()- Throws:
IllegalStateException- if the element cannot be added at this time due to capacity restrictionsClassCastException- if the class of the specified element prevents it from being added to this dequeNullPointerException- if the specified element is null and this deque does not permit null elementsIllegalArgumentException- if some property of the specified element prevents it from being added to this deque
-
addLast
Inserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions, throwing anIllegalStateExceptionif no space is currently available. When using a capacity-restricted deque, it is generally preferable to use methodofferLast(E, long).This method is equivalent to
NamedQueue.add(E, long).- Parameters:
e- the element to addcMillis- the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; passNamedQueue.EXPIRY_DEFAULTto use the queue's default time-to-live setting; passNamedQueue.EXPIRY_NEVERto indicate that the queue entry should never expire; this milliseconds value is not a date/time value, such as is returned from System.currentTimeMillis()- Throws:
IllegalStateException- if the element cannot be added at this time due to capacity restrictionsClassCastException- if the class of the specified element prevents it from being added to this dequeNullPointerException- if the specified element is null and this deque does not permit null elementsIllegalArgumentException- if some property of the specified element prevents it from being added to this deque
-
offerFirst
Inserts the specified element at the front of this deque unless it would violate capacity restrictions. When using a capacity-restricted deque, this method is generally preferable to theaddFirst(E, long)method, which can fail to insert an element only by throwing an exception.- Parameters:
e- the element to addcMillis- the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; passNamedQueue.EXPIRY_DEFAULTto use the queue's default time-to-live setting; passNamedQueue.EXPIRY_NEVERto indicate that the queue entry should never expire; this milliseconds value is not a date/time value, such as is returned from System.currentTimeMillis()- Returns:
trueif the element was added to this deque, elsefalse- Throws:
ClassCastException- if the class of the specified element prevents it from being added to this dequeNullPointerException- if the specified element is null and this deque does not permit null elementsIllegalArgumentException- if some property of the specified element prevents it from being added to this deque
-
offerLast
Inserts the specified element at the end of this deque unless it would violate capacity restrictions. When using a capacity-restricted deque, this method is generally preferable to theaddLast(E, long)method, which can fail to insert an element only by throwing an exception.- Parameters:
e- the element to addcMillis- the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; passNamedQueue.EXPIRY_DEFAULTto use the queue's default time-to-live setting; passNamedQueue.EXPIRY_NEVERto indicate that the queue entry should never expire; this milliseconds value is not a date/time value, such as is returned from System.currentTimeMillis()- Returns:
trueif the element was added to this deque, elsefalse- Throws:
ClassCastException- if the class of the specified element prevents it from being added to this dequeNullPointerException- if the specified element is null and this deque does not permit null elementsIllegalArgumentException- if some property of the specified element prevents it from being added to this deque
-
push
Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it is possible to do so immediately without violating capacity restrictions, throwing anIllegalStateExceptionif no space is currently available.This method is equivalent to
addFirst(E, long).- Parameters:
e- the element to pushcMillis- the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; passNamedQueue.EXPIRY_DEFAULTto use the queue's default time-to-live setting; passNamedQueue.EXPIRY_NEVERto indicate that the queue entry should never expire; this milliseconds value is not a date/time value, such as is returned from System.currentTimeMillis()- Throws:
IllegalStateException- if the element cannot be added at this time due to capacity restrictionsClassCastException- if the class of the specified element prevents it from being added to this dequeNullPointerException- if the specified element is null and this deque does not permit null elementsIllegalArgumentException- if some property of the specified element prevents it from being added to this deque
-