/** * Pull one item from the queue’s tail if there is one. * * Use this method only from the consumer thread! * * @return element if there was one, or null if there was none */ public final T poll() { final Node<T> next = pollNode(); if (next == null) return null; else { T value = next.value; next.value = null; return value; } }
/** * Pull one item from the queue’s tail if there is one. * * Use this method only from the consumer thread! * * @return element if there was one, or null if there was none */ public final T poll() { final Node<T> next = pollNode(); if (next == null) return null; else { T value = next.value; next.value = null; return value; } }
/** * Pull one item from the queue’s tail if there is one. * * Use this method only from the consumer thread! * * @return element if there was one, or null if there was none */ public final T poll() { final Node<T> next = pollNode(); if (next == null) return null; else { T value = next.value; next.value = null; return value; } }
/** * Pull one item from the queue’s tail if there is one. * * Use this method only from the consumer thread! * * @return element if there was one, or null if there was none */ public final T poll() { final Node<T> next = pollNode(); if (next == null) return null; else { T value = next.value; next.value = null; return value; } }
/** * Pull one item from the queue’s tail if there is one. * * Use this method only from the consumer thread! * * @return element if there was one, or null if there was none */ public final T poll() { final Node<T> next = pollNode(); if (next == null) return null; else { T value = next.value; next.value = null; return value; } }
/** * Pull one item from the queue’s tail if there is one. * * Use this method only from the consumer thread! * * @return element if there was one, or null if there was none */ public final T poll() { final Node<T> next = pollNode(); if (next == null) return null; else { T value = next.value; next.value = null; return value; } }