Statistics
| Revision:

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

History | View | Annotate | Download (1.63 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.PropertyIsLessThan;
21
import org.opengis.filter.expression.Expression;
22
/**
23
 * @author jdeolive
24
 */
25
public class IsLessThenImpl extends BinaryComparisonAbstract implements
26
                PropertyIsLessThan {
27

    
28
        
29
        protected IsLessThenImpl(Expression expression1, Expression expression2) {
30
                super(expression1, expression2);
31
        }
32
        
33
        //@Override
34
        public boolean evaluate(Object feature) {
35
//                Object[] values = eval( feature );
36
//                Comparable value1 = comparable( values[ 0 ] );
37
//                Comparable value2 = comparable( values[ 1 ] );
38
                Comparable value1 = comparable( expression1.evaluate(feature) );
39
                Comparable value2 = comparable( expression2.evaluate(feature) );
40
                return value1 != null && value2 != null && compare(value1,value2) < 0;
41
        }
42

    
43
        public Object accept(FilterVisitor visitor, Object extraData) {
44
                return visitor.visit(this,extraData);
45
        }
46
}