01: package com.canoo.ant.filter;
02:
03: import java.util.LinkedList;
04: import java.util.List;
05:
06: /**
07: * A Filter that matches the first Property object
08: * for each distinct propValue
09: */
10: public class GroupFilter extends ATableFilter {
11:
12: List fGroup;
13:
14: public GroupFilter() {
15: }
16:
17: public GroupFilter(String foreignName) {
18: super (foreignName);
19: }
20:
21: protected void reset() {
22: fGroup = new LinkedList();
23: }
24:
25: protected boolean matches(String expected, String runningValue) {
26: if (fGroup.contains(runningValue)) {
27: return false;
28: }
29: fGroup.add(runningValue);
30: return true;
31: }
32:
33: protected boolean stopOnMatch() {
34: return false;
35: }
36: }
|