/** * Create a new list by applying a {@link LocationFilter} to all the * elements of this list. Only items which are accepted by the filter will * be added to the new list. * * @param locationFilter * the location filter * @return a filtered list */ public MemoryLocalFeatureList<T> filter(LocationFilter locationFilter) { final MemoryLocalFeatureList<T> newlist = new MemoryLocalFeatureList<T>(); for (final T t : this) { if (locationFilter.accept(t.getLocation())) newlist.add(t); } return newlist; }
/** * Create a new list by applying a {@link LocationFilter} to all the * elements of this list. Only items which are accepted by the filter will * be added to the new list. * * @param locationFilter * the location filter * @return a filtered list */ public MemoryLocalFeatureList<T> filter(LocationFilter locationFilter) { final MemoryLocalFeatureList<T> newlist = new MemoryLocalFeatureList<T>(); for (final T t : this) { if (locationFilter.accept(t.getLocation())) newlist.add(t); } return newlist; }