Java BlockingDeque .removeFirstOccurrence (Object o)

Syntax

BlockingDeque.removeFirstOccurrence(Object o) has the following syntax.

boolean removeFirstOccurrence(Object o)

Example

In the following code shows how to use BlockingDeque.removeFirstOccurrence(Object o) method.


import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
/*from w ww  .  ja v  a 2  s  .  co  m*/
public class Main {
  public static void main(String[] argv) throws Exception {
    int capacity = 10;
    BlockingQueue<Integer> queue = new ArrayBlockingQueue<Integer>(capacity);

    for (int i = 0; i < 10; i++) {
      queue.add(i);
    }
    
   // System.out.println(queue.removeFirstOccurrence(new Integer(0)));
  }
}




















Home »
  Java Tutorial »
    java.util.concurrent »




ArrayBlockingQueue
BlockingDeque
CountDownLatch
CyclicBarrier
TimeUnit