1 package net.sf.flock.filter;
2
3 import java.util.List;
4 import java.util.ListIterator;
5
6 import net.sf.flock.FilterI;
7 import net.sf.flock.ItemI;
8
9 public class MetaStartsWith implements FilterI {
10
11 private final String key;
12 private final String value;
13
14 public MetaStartsWith(String key, String value) {
15 this.key = key;
16 this.value = value;
17 }
18
19 public List filter(List items) {
20 for (ListIterator i=items.listIterator(); i.hasNext(); ) {
21 ItemI item = (ItemI)i.next();
22
23 String val = item.getOrigin().getSubscriptionInfo().getMetaData().get(this.key);
24
25 if (val==null || !val.startsWith(this.value)) {
26 i.remove();
27 }
28 }
29 return items;
30 }
31
32 }
This page was automatically generated by Maven