/** * Identity-based version for use in Itr.remove */ void removeEQ(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { Object[] array = queue; for (int i = 0, n = size; i < n; i++) { if (o == array[i]) { removeAt(i); break; } } } finally { lock.unlock(); } }
/** * Removes a single instance of the specified element from this queue, * if it is present. More formally, removes an element {@code e} such * that {@code o.equals(e)}, if this queue contains one or more such * elements. Returns {@code true} if and only if this queue contained * the specified element (or equivalently, if this queue changed as a * result of the call). * * @param o element to be removed from this queue, if present * @return {@code true} if this queue changed as a result of the call */ public boolean remove(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { int i = indexOf(o); if (i == -1) return false; removeAt(i); return true; } finally { lock.unlock(); } }
/** * Identity-based version for use in Itr.remove */ void removeEQ(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { Object[] array = queue; for (int i = 0, n = size; i < n; i++) { if (o == array[i]) { removeAt(i); break; } } } finally { lock.unlock(); } }
/** * Identity-based version for use in Itr.remove */ void removeEQ(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { Object[] array = queue; for (int i = 0, n = size; i < n; i++) { if (o == array[i]) { removeAt(i); break; } } } finally { lock.unlock(); } }
/** * Identity-based version for use in Itr.remove */ void removeEQ(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { Object[] array = queue; for (int i = 0, n = size; i < n; i++) { if (o == array[i]) { removeAt(i); break; } } } finally { lock.unlock(); } }
/** * Identity-based version for use in Itr.remove */ void removeEQ(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { Object[] array = queue; for (int i = 0, n = size; i < n; i++) { if (o == array[i]) { removeAt(i); break; } } } finally { lock.unlock(); } }
/** * Identity-based version for use in Itr.remove */ void removeEQ(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { Object[] array = queue; for (int i = 0, n = size; i < n; i++) { if (o == array[i]) { removeAt(i); break; } } } finally { lock.unlock(); } }
/** * Identity-based version for use in Itr.remove */ void removeEQ(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { Object[] array = queue; for (int i = 0, n = size; i < n; i++) { if (o == array[i]) { removeAt(i); break; } } } finally { lock.unlock(); } }
/** * Identity-based version for use in Itr.remove */ private void removeEQ(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { Object[] array = queue; int n = size; for (int i = 0; i < n; i++) { if (o == array[i]) { removeAt(i); break; } } } finally { lock.unlock(); } }
/** * Identity-based version for use in Itr.remove */ private void removeEQ(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { Object[] array = queue; int n = size; for (int i = 0; i < n; i++) { if (o == array[i]) { removeAt(i); break; } } } finally { lock.unlock(); } }
/** * Identity-based version for use in Itr.remove */ private void removeEQ(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { Object[] array = queue; int n = size; for (int i = 0; i < n; i++) { if (o == array[i]) { removeAt(i); break; } } } finally { lock.unlock(); } }
/** * Removes a single instance of the specified element from this queue, * if it is present. More formally, removes an element {@code e} such * that {@code o.equals(e)}, if this queue contains one or more such * elements. Returns {@code true} if and only if this queue contained * the specified element (or equivalently, if this queue changed as a * result of the call). * * @param o element to be removed from this queue, if present * @return {@code true} if this queue changed as a result of the call */ public boolean remove(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { int i = indexOf(o); if (i == -1) return false; removeAt(i); return true; } finally { lock.unlock(); } }
/** * Removes a single instance of the specified element from this queue, * if it is present. More formally, removes an element {@code e} such * that {@code o.equals(e)}, if this queue contains one or more such * elements. Returns {@code true} if and only if this queue contained * the specified element (or equivalently, if this queue changed as a * result of the call). * * @param o element to be removed from this queue, if present * @return {@code true} if this queue changed as a result of the call */ public boolean remove(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { int i = indexOf(o); if (i == -1) return false; removeAt(i); return true; } finally { lock.unlock(); } }
/** * Removes a single instance of the specified element from this queue, * if it is present. More formally, removes an element {@code e} such * that {@code o.equals(e)}, if this queue contains one or more such * elements. Returns {@code true} if and only if this queue contained * the specified element (or equivalently, if this queue changed as a * result of the call). * * @param o element to be removed from this queue, if present * @return {@code true} if this queue changed as a result of the call */ public boolean remove(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { int i = indexOf(o); if (i == -1) return false; removeAt(i); return true; } finally { lock.unlock(); } }
/** * Removes a single instance of the specified element from this queue, * if it is present. More formally, removes an element {@code e} such * that {@code o.equals(e)}, if this queue contains one or more such * elements. Returns {@code true} if and only if this queue contained * the specified element (or equivalently, if this queue changed as a * result of the call). * * @param o element to be removed from this queue, if present * @return {@code true} if this queue changed as a result of the call */ public boolean remove(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { int i = indexOf(o); if (i == -1) return false; removeAt(i); return true; } finally { lock.unlock(); } }
/** * Removes a single instance of the specified element from this queue, * if it is present. More formally, removes an element {@code e} such * that {@code o.equals(e)}, if this queue contains one or more such * elements. Returns {@code true} if and only if this queue contained * the specified element (or equivalently, if this queue changed as a * result of the call). * * @param o element to be removed from this queue, if present * @return {@code true} if this queue changed as a result of the call */ public boolean remove(Object o) { boolean removed = false; final ReentrantLock lock = this.lock; lock.lock(); try { int i = indexOf(o); if (i != -1) { removeAt(i); removed = true; } } finally { lock.unlock(); } return removed; }
/** * Removes a single instance of the specified element from this queue, * if it is present. More formally, removes an element {@code e} such * that {@code o.equals(e)}, if this queue contains one or more such * elements. Returns {@code true} if and only if this queue contained * the specified element (or equivalently, if this queue changed as a * result of the call). * * @param o element to be removed from this queue, if present * @return {@code true} if this queue changed as a result of the call */ public boolean remove(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { int i = indexOf(o); if (i == -1) return false; removeAt(i); return true; } finally { lock.unlock(); } }
/** * Removes a single instance of the specified element from this queue, * if it is present. More formally, removes an element {@code e} such * that {@code o.equals(e)}, if this queue contains one or more such * elements. Returns {@code true} if and only if this queue contained * the specified element (or equivalently, if this queue changed as a * result of the call). * * @param o element to be removed from this queue, if present * @return {@code true} if this queue changed as a result of the call */ public boolean remove(Object o) { boolean removed = false; final ReentrantLock lock = this.lock; lock.lock(); try { int i = indexOf(o); if (i != -1) { removeAt(i); removed = true; } } finally { lock.unlock(); } return removed; }
/** * Removes a single instance of the specified element from this queue, * if it is present. More formally, removes an element {@code e} such * that {@code o.equals(e)}, if this queue contains one or more such * elements. Returns {@code true} if and only if this queue contained * the specified element (or equivalently, if this queue changed as a * result of the call). * * @param o element to be removed from this queue, if present * @return {@code true} if this queue changed as a result of the call */ public boolean remove(Object o) { final ReentrantLock lock = this.lock; lock.lock(); try { int i = indexOf(o); if (i == -1) return false; removeAt(i); return true; } finally { lock.unlock(); } }
/** * Removes a single instance of the specified element from this queue, * if it is present. More formally, removes an element {@code e} such * that {@code o.equals(e)}, if this queue contains one or more such * elements. Returns {@code true} if and only if this queue contained * the specified element (or equivalently, if this queue changed as a * result of the call). * * @param o element to be removed from this queue, if present * @return {@code true} if this queue changed as a result of the call */ public boolean remove(Object o) { boolean removed = false; final ReentrantLock lock = this.lock; lock.lock(); try { int i = indexOf(o); if (i != -1) { removeAt(i); removed = true; } } finally { lock.unlock(); } return removed; }