/** * Query the queue tail for the next element without dequeuing it. * * Use this method only from the consumer thread! * * @return element if there was one, or null if there was none */ public final T peek() { final Node<T> n = peekNode(); return (n != null) ? n.value : null; }
/** * Query the queue tail for the next element without dequeuing it. * * Use this method only from the consumer thread! * * @return element if there was one, or null if there was none */ public final T peek() { final Node<T> n = peekNode(); return (n != null) ? n.value : null; }
/** * Query the queue tail for the next element without dequeuing it. * * Use this method only from the consumer thread! * * @return element if there was one, or null if there was none */ public final T peek() { final Node<T> n = peekNode(); return (n != null) ? n.value : null; }
/** * Query the queue tail for the next element without dequeuing it. * * Use this method only from the consumer thread! * * @return element if there was one, or null if there was none */ public final T peek() { final Node<T> n = peekNode(); return (n != null) ? n.value : null; }
/** * Query the queue tail for the next element without dequeuing it. * * Use this method only from the consumer thread! * * @return element if there was one, or null if there was none */ public final T peek() { final Node<T> n = peekNode(); return (n != null) ? n.value : null; }
/** * Query the queue tail for the next element without dequeuing it. * * Use this method only from the consumer thread! * * @return element if there was one, or null if there was none */ public final T peek() { final Node<T> n = peekNode(); return (n != null) ? n.value : null; }
public final T peek() { final Node<T> n = peekNode(); return (n != null) ? n.value : null; }
public final T peek() { final Node<T> n = peekNode(); return (n != null) ? n.value : null; }
public final T poll() { final Node<T> next = peekNode(); if (next == null) return null; else { final T ret = next.value; next.value = null; Unsafe.instance.putOrderedObject(this, tailOffset, next); return ret; } }
public final int count() { int count = 0; for(Node<T> n = peekNode();n != null; n = n.next()) ++count; return count; }
public final T poll() { final Node<T> next = peekNode(); if (next == null) return null; else { final T ret = next.value; next.value = null; Unsafe.instance.putOrderedObject(this, tailOffset, next); return ret; } }
public final int count() { int count = 0; for(Node<T> n = peekNode();n != null; n = n.next()) ++count; return count; }