/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public E peek() { if (isEmpty()) { return null; } return (E) items[first]; }
@SuppressWarnings("unchecked") public E peek() { if (isEmpty()) { return null; } return (E) items[first]; }
/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public E peek() { if (isEmpty()) { return null; } return (E) items[first]; }
public E remove() { if (isEmpty()) { throw new NoSuchElementException(); } return poll(); }
/** * {@inheritDoc} */ @Override public E element() { if (isEmpty()) { throw new NoSuchElementException(); } return peek(); } }
/** * {@inheritDoc} */ @Override public E remove() { if (isEmpty()) { throw new NoSuchElementException(); } return poll(); }
/** * {@inheritDoc} */ @Override public E element() { if (isEmpty()) { throw new NoSuchElementException(); } return peek(); } }
/** * {@inheritDoc} */ @Override public E remove() { if (isEmpty()) { throw new NoSuchElementException(); } return poll(); }
/** * {@inheritDoc} */ @Override public void clear() { if (!isEmpty()) { Arrays.fill(items, null); first = 0; last = 0; full = false; shrinkIfNeeded(); } }
@Override public void clear() { if (!isEmpty()) { Arrays.fill(items, null); first = 0; last = 0; full = false; shrinkIfNeeded(); } }
public E element() { if (isEmpty()) { throw new NoSuchElementException(); } return peek(); } }
/** * {@inheritDoc} */ @Override public void clear() { if (!isEmpty()) { Arrays.fill(items, null); first = 0; last = 0; full = false; shrinkIfNeeded(); } }
@SuppressWarnings("unchecked") public E poll() { if (isEmpty()) { return null; } Object ret = items[first]; items[first] = null; decreaseSize(); if (first == last) { first = last = 0; } shrinkIfNeeded(); return (E) ret; }
/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public E poll() { if (isEmpty()) { return null; } Object ret = items[first]; items[first] = null; decreaseSize(); if (first == last) { first = last = 0; } shrinkIfNeeded(); return (E) ret; }
/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public E poll() { if (isEmpty()) { return null; } Object ret = items[first]; items[first] = null; decreaseSize(); if (first == last) { first = last = 0; } shrinkIfNeeded(); return (E) ret; }