Vector<Filter> candidates = new Vector<Filter>();
for (Filter filter : getGraph().getFilters()) {
if (filter.canProcess())
candidates.add(filter);
}
if (candidates.size() > 0) {
int r = mRand.nextInt(candidates.size());
return candidates.elementAt(r);
}
return null;