Statistics
| Revision:

root / branches / Mobile_Compatible_Hito_1 / libFMap_data / src / org / gvsig / data / vectorial / filter / IsLessThenOrEqualToImpl.java @ 21563

History | View | Annotate | Download (1.64 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 org.opengis.filter.FilterFactory;
19
import org.opengis.filter.FilterVisitor;
20
import org.opengis.filter.PropertyIsLessThanOrEqualTo;
21
import org.opengis.filter.expression.Expression;
22

    
23
public class IsLessThenOrEqualToImpl extends BinaryComparisonAbstract implements
24
                PropertyIsLessThanOrEqualTo {
25
        
26
        
27
        protected IsLessThenOrEqualToImpl(Expression expression1, Expression expression2) {
28
                super(expression1, expression2);
29
                
30
        }
31

    
32
        //@Override
33
        public boolean evaluate(Object feature) {
34
//                Object[] values = eval( feature );
35
//                Comparable value1 = comparable( values[ 0 ] );
36
//                Comparable value2 = comparable( values[ 1 ] );
37
                Comparable value1 = comparable( expression1.evaluate(feature) );
38
                Comparable value2 = comparable( expression2.evaluate(feature) );
39
                return value1 != null && value2 != null && compare(value1,value2) <= 0;
40
        }
41
        
42
        public Object accept(FilterVisitor visitor, Object extraData) {
43
                return visitor.visit(this,extraData);
44
        }
45
}