Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libAnimation / src / com / iver / cit / gvsig / animation / dateFilter / IndexFilter.java @ 23598

History | View | Annotate | Download (3.04 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*/
19

    
20
package com.iver.cit.gvsig.animation.dateFilter;
21

    
22
//import com.hardcode.gdbms.engine.values.NullValue;
23
//import com.hardcode.gdbms.engine.values.NumericValue;
24
//import com.hardcode.gdbms.engine.values.Value;
25
//import com.iver.cit.gvsig.fmap.core.IFeature;
26
//import com.iver.utiles.IPersistence;
27
//import com.iver.utiles.XMLEntity;
28

    
29
//public class IndexFilter implements ICustomVectorialFilter, IPersistence {
30
        public class IndexFilter  {
31

    
32
//        private int filterFieldIndex=-1;
33
//        private int minIndex = -1;
34
//        private int maxIndex = -1;
35
//        
36
//        public void setFieldIndex(int index) {
37
//                filterFieldIndex = index;
38
//        }
39
//        
40
//        // if type is INTEGER, use these instead of setMinDate/setMaxDate
41
//        // internally, the int value is used as year
42
//        public void setMinIndex(int miniIndex) {
43
//                minIndex = miniIndex;
44
//        }
45
//        
46
//        public void setMaxIndex(int maxiIndex) {
47
//                maxIndex = maxiIndex;
48
//        }
49
//        
50
//        public boolean accepts(IFeature feature) {
51
//                
52
//                Value val = feature.getAttribute(filterFieldIndex);
53
//                if (val instanceof NullValue)
54
//                        return false;
55
//                
56
//                if (!(val instanceof NumericValue))
57
//                        return false;
58
//                
59
//                int intVal = ((NumericValue)val).intValue();
60
//        
61
//                if (intVal < minIndex)
62
//                    return false;
63
//                
64
//                if (intVal > maxIndex)
65
//                    return false;
66
//                        
67
//                return true;
68
//        }
69
//
70
//        public String getClassName() {
71
//                return this.getClass().getName();
72
//        }
73
//
74
//        public XMLEntity getXMLEntity() {
75
//                XMLEntity xml = new XMLEntity();
76
//
77
//                xml.putProperty("fieldIndex", filterFieldIndex);
78
//                xml.putProperty("minIndex", minIndex);
79
//                xml.putProperty("maxIndex", maxIndex);
80
//
81
//                return xml;
82
//        }
83
//
84
//        public void setXMLEntity(XMLEntity xml) {
85
//
86
//                if (xml.contains("fieldIndex"))
87
//                        filterFieldIndex = xml.getIntProperty("fieldIndex");
88
//                
89
//                if (xml.contains("minIndex"))
90
//                        minIndex = xml.getIntProperty("minIndex");
91
//
92
//                if (xml.contains("maxIndex"))
93
//                        maxIndex = xml.getIntProperty("maxIndex");
94
//        }
95
//
96
//        public boolean compareTo(ICustomVectorialFilter filter) {
97
//                IndexFilter filterAux = (IndexFilter) filter;
98
//
99
//                return ((this.minIndex == filterAux.minIndex) && (this.maxIndex == filterAux.maxIndex));
100
//        }
101

    
102
}