Interface LongDeque

All Superinterfaces:
Iterable<LongCursor>, LongCollection, LongContainer
All Known Implementing Classes:
LongArrayDeque

@Generated(date="2023-10-26T04:33:09+0000", value="KTypeDeque.java") public interface LongDeque extends LongCollection
A linear collection that supports element insertion and removal at both ends.
See Also:
  • Method Details

    • removeFirst

      int removeFirst(long e)
      Removes the first element that equals e.
      Returns:
      The deleted element's index or -1 if the element was not found.
    • removeLast

      int removeLast(long e)
      Removes the last element that equals e.
      Returns:
      The deleted element's index or -1 if the element was not found.
    • addFirst

      void addFirst(long e)
      Inserts the specified element at the front of this deque.
    • addLast

      void addLast(long e)
      Inserts the specified element at the end of this deque.
    • removeFirst

      long removeFirst()
      Retrieves and removes the first element of this deque.
      Returns:
      the head (first) element of this deque.
    • removeLast

      long removeLast()
      Retrieves and removes the last element of this deque.
      Returns:
      the tail of this deque.
    • getFirst

      long getFirst()
      Retrieves the first element of this deque but does not remove it.
      Returns:
      the head of this deque.
    • getLast

      long getLast()
      Retrieves the last element of this deque but does not remove it.
      Returns:
      the head of this deque.
    • descendingIterator

      Iterator<LongCursor> descendingIterator()
      Returns:
      An iterator over elements in this deque in tail-to-head order.
    • descendingForEach

      <T extends LongProcedure> T descendingForEach(T procedure)
      Applies a procedure to all elements in tail-to-head order.
    • descendingForEach

      <T extends LongPredicate> T descendingForEach(T predicate)
      Applies a predicate to container elements as long, as the predicate returns true. The iteration is interrupted otherwise.