/** * Inserts the specified element at the front of this deque. * As the deque is unbounded, this method will never throw * {@link IllegalStateException}. * * @throws NullPointerException if the specified element is null */ public void addFirst(E e) { linkFirst(e); }
/** * Inserts the specified element at the front of this deque. * As the deque is unbounded, this method will never return {@code false}. * * @return {@code true} (as specified by {@link Deque#offerFirst}) * @throws NullPointerException if the specified element is null */ public boolean offerFirst(E e) { linkFirst(e); return true; }