List of usage examples for java.util.concurrent ArrayBlockingQueue clear
public void clear()
From source file:Main.java
public static void main(String[] argv) throws Exception { int capacity = 100; ArrayBlockingQueue<Integer> queue = new ArrayBlockingQueue<Integer>(capacity); for (int i = 0; i < 100; i++) { queue.add(i);//from w ww.j a v a2 s . c o m } queue.clear(); }
From source file:Main.java
public static void main(String[] argv) throws Exception { int capacity = 100; ArrayBlockingQueue<Integer> queue = new ArrayBlockingQueue<Integer>(capacity); for (int i = 0; i < 100; i++) { queue.add(i);/*from w w w . ja va 2s .c om*/ } System.out.println(queue.contains(5)); queue.clear(); System.out.println(queue.contains(5)); }