@CanIgnoreReturnValue @Override public E poll() { return isEmpty() ? null : removeAndGet(0); }
/** * Removes and returns the greatest element of this queue. * * @throws NoSuchElementException if the queue is empty */ @CanIgnoreReturnValue public E removeLast() { if (isEmpty()) { throw new NoSuchElementException(); } return removeAndGet(getMaxElementIndex()); }
/** * Removes and returns the greatest element of this queue, or returns {@code * null} if the queue is empty. */ @CanIgnoreReturnValue public E pollLast() { return isEmpty() ? null : removeAndGet(getMaxElementIndex()); }