List of usage examples for java.util.concurrent ArrayBlockingQueue iterator
public Iterator<E> iterator()
From source file:Main.java
public static void main(String[] argv) throws Exception { int capacity = 10; ArrayBlockingQueue<Integer> queue = new ArrayBlockingQueue<Integer>(capacity); for (int i = 0; i < 10; i++) { queue.add(i);/*from w w w.ja v a 2s . c o m*/ } Iterator<Integer> it = queue.iterator(); while (it.hasNext()) { System.out.println(it.next()); } }