protected List buildBackingCollection(Collection c, Predicate p, Comparator comp) { List new_backing_collection = new ArrayList(c.size()); if (p != null && p != TruePredicate.getInstance()) { for (Iterator iter = c.iterator(); iter.hasNext(); ) { Object o = iter.next(); if (p.evaluate(o)) new_backing_collection.add(o); } } if (comp != null) Collections.sort(new_backing_collection, comp); return new_backing_collection; }
/** * Walk entries. * * @param handler * handler to call. * @throws IllegalArgumentException * if handler is null. */ public void walk(final Closure handler) throws IllegalArgumentException { this.walk(handler, TruePredicate.INSTANCE); }
/** * Walk entries. * * @param handler * handler to call. * @throws IllegalArgumentException * if handler is null. */ public void walk( final Closure handler ) throws IllegalArgumentException { this.walk( handler, TruePredicate.INSTANCE ); }