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

public interface NamedDeque<E> extends NamedQueue<E>, Deque<E>
A Deque based data-structure that manages values across one or more processes. Values are typically managed in memory.
  • Method Details

    • getService

      QueueService getService()
      Description copied from interface: NamedCollection
      Return the Service that this NamedCollection is a part of.
      Specified by:
      getService in interface NamedCollection
      Specified by:
      getService in interface NamedQueue<E>
      Returns:
      the Service
    • prepend

      default long prepend(E e)
      Insert an element to head of this NamedDeque.
      Parameters:
      e - the element to insert
      Returns:
      the identifier for the inserted element, or Long.MIN_VALUE if the element could not be inserted
    • prepend

      long prepend(E e, long cMillis)
      Insert an element to head of this NamedDeque.
      Parameters:
      e - the element to insert
      cMillis - the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; pass NamedQueue.EXPIRY_DEFAULT to use the queue's default time-to-live setting; pass NamedQueue.EXPIRY_NEVER to 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_VALUE if the element could not be inserted
    • addFirst

      void addFirst(E e, long cMillis)
      Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions, throwing an IllegalStateException if no space is currently available. When using a capacity-restricted deque, it is generally preferable to use method offerFirst(E, long).
      Parameters:
      e - the element to add
      cMillis - the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; pass NamedQueue.EXPIRY_DEFAULT to use the queue's default time-to-live setting; pass NamedQueue.EXPIRY_NEVER to 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 restrictions
      ClassCastException - if the class of the specified element prevents it from being added to this deque
      NullPointerException - if the specified element is null and this deque does not permit null elements
      IllegalArgumentException - if some property of the specified element prevents it from being added to this deque
    • addLast

      void addLast(E e, long cMillis)
      Inserts the specified element at the end of this deque if it is possible to do so immediately without violating capacity restrictions, throwing an IllegalStateException if no space is currently available. When using a capacity-restricted deque, it is generally preferable to use method offerLast(E, long).

      This method is equivalent to NamedQueue.add(E, long).

      Parameters:
      e - the element to add
      cMillis - the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; pass NamedQueue.EXPIRY_DEFAULT to use the queue's default time-to-live setting; pass NamedQueue.EXPIRY_NEVER to 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 restrictions
      ClassCastException - if the class of the specified element prevents it from being added to this deque
      NullPointerException - if the specified element is null and this deque does not permit null elements
      IllegalArgumentException - if some property of the specified element prevents it from being added to this deque
    • offerFirst

      boolean offerFirst(E e, long cMillis)
      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 the addFirst(E, long) method, which can fail to insert an element only by throwing an exception.
      Parameters:
      e - the element to add
      cMillis - the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; pass NamedQueue.EXPIRY_DEFAULT to use the queue's default time-to-live setting; pass NamedQueue.EXPIRY_NEVER to 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:
      true if the element was added to this deque, else false
      Throws:
      ClassCastException - if the class of the specified element prevents it from being added to this deque
      NullPointerException - if the specified element is null and this deque does not permit null elements
      IllegalArgumentException - if some property of the specified element prevents it from being added to this deque
    • offerLast

      boolean offerLast(E e, long cMillis)
      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 the addLast(E, long) method, which can fail to insert an element only by throwing an exception.
      Parameters:
      e - the element to add
      cMillis - the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; pass NamedQueue.EXPIRY_DEFAULT to use the queue's default time-to-live setting; pass NamedQueue.EXPIRY_NEVER to 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:
      true if the element was added to this deque, else false
      Throws:
      ClassCastException - if the class of the specified element prevents it from being added to this deque
      NullPointerException - if the specified element is null and this deque does not permit null elements
      IllegalArgumentException - if some property of the specified element prevents it from being added to this deque
    • push

      void push(E e, long cMillis)
      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 an IllegalStateException if no space is currently available.

      This method is equivalent to addFirst(E, long).

      Parameters:
      e - the element to push
      cMillis - the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; pass NamedQueue.EXPIRY_DEFAULT to use the queue's default time-to-live setting; pass NamedQueue.EXPIRY_NEVER to 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 restrictions
      ClassCastException - if the class of the specified element prevents it from being added to this deque
      NullPointerException - if the specified element is null and this deque does not permit null elements
      IllegalArgumentException - if some property of the specified element prevents it from being added to this deque