public void fillQueue() { try { BufferedReader reader = new BufferedReader(new FileReader(mSource)); String line = null; int count = 0; while ((line = reader.readLine()) != null) { URL url = new URL(line); queue.enqueue(new BookThingISBNWorker(url)); count++; } } catch (Exception e) { e.printStackTrace(); } }
public void start() { queue.start(); }
public boolean hasItems() { synchronized (queue) { return queue.remainingItems() > 0; } }