Normand Briere
2018-07-07 e416acb9b012b17d1efe49ad2199ea7132d874d1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package timeflow.data.db.filter;
 
import timeflow.data.db.*;
import timeflow.data.time.*;
 
public class NumericRangeFilter extends ActFilter {
   
   double low, high;
   Field field;
   boolean acceptNull;
   
   public NumericRangeFilter(Field field, double low, double high, boolean acceptNull)
   {
       this.low=low;
       this.high=high;
       this.field=field;
       this.acceptNull=acceptNull;
   }
 
   @Override
   public boolean accept(Act act) {
       if (field==null)
           return false;
       double x=act.getValue(field);
       return Double.isNaN(x) && acceptNull || x>=low && x<=high;
   }
 
}