root / branches / Mobile_Compatible_Hito_1 / libFMap_data / src / org / gvsig / data / vectorial / filter / OrImpl.java @ 21563
History | View | Annotate | Download (1.5 KB)
1 |
/*
|
---|---|
2 |
* GeoTools - OpenSource mapping toolkit
|
3 |
* http://geotools.org
|
4 |
* (C) 2006, GeoTools Project Managment Committee (PMC)
|
5 |
*
|
6 |
* This library is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU Lesser General Public
|
8 |
* License as published by the Free Software Foundation;
|
9 |
* version 2.1 of the License.
|
10 |
*
|
11 |
* This library is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 |
* Lesser General Public License for more details.
|
15 |
*/
|
16 |
package org.gvsig.data.vectorial.filter; |
17 |
|
18 |
import java.util.Iterator; |
19 |
import java.util.List; |
20 |
|
21 |
import org.opengis.filter.Filter; |
22 |
import org.opengis.filter.FilterFactory; |
23 |
import org.opengis.filter.FilterVisitor; |
24 |
import org.opengis.filter.Or; |
25 |
/**
|
26 |
* @author jdeolive
|
27 |
*/
|
28 |
public class OrImpl implements Or { |
29 |
/**
|
30 |
* list of filters
|
31 |
*/
|
32 |
List children;
|
33 |
|
34 |
protected OrImpl(List children) { |
35 |
this.children = children;
|
36 |
} |
37 |
|
38 |
public boolean evaluate(Object feature) { |
39 |
for (Iterator itr = children.iterator(); itr.hasNext();) { |
40 |
Filter filter = (Filter)itr.next(); |
41 |
if( filter.evaluate( feature )) {
|
42 |
return true; |
43 |
} |
44 |
} |
45 |
return false; |
46 |
} |
47 |
|
48 |
public Object accept(FilterVisitor visitor, Object extraData) { |
49 |
return visitor.visit(this,extraData); |
50 |
} |
51 |
|
52 |
public List getChildren() { |
53 |
return children;
|
54 |
} |
55 |
|
56 |
} |
57 |
|