@Override public void onQueryRemoved(RegexQuery query) { boolean forceStopAll = !pool.containsQueries(); synchronized (poolSearchReferences) { for (PoolSearch search : poolSearchReferences) { search.isSearching = false; search.forceStop = forceStopAll; } } }
@Override public void run() { pool.registerListener(this); setStartTimeToNow(); switch (searchMode) { case SEARCH_ALL: searchAll(); break; case EASIEST_HARDEST: case HARDEST_EASIEST: case SHORTEST_LONGEST: case LONGEST_SHORTEST: customSearch(); break; } if (!pool.containsQueries()) { taskCompleted(generated, getGeneratedPerSecond()); } pool.unregisterListener(this); }