Revision 44855 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/main/java/org/gvsig/expressionevaluator/impl/function/operator/GeOperator.java

View differences:

GeOperator.java
21 21
    public Object call(Interpreter interpreter, Object op1, Object op2) {       
22 22
        int type = this.getType(op1, op2);
23 23
        if( (type & TYPE_DOUBLE) == TYPE_DOUBLE ) {
24
            boolean value = MathUtils.compareTo(
25
                ((Number) op1).doubleValue(), 
26
                ((Number) op2).doubleValue(),
27
                interpreter.getAccuracy()==null? MathUtils.EPSILON:interpreter.getAccuracy()
28
            ) >= 0;
24
            double accuracy = MathUtils.EPSILON;
25
            if( interpreter.getAccuracy()!=null ) {
26
              accuracy = interpreter.getAccuracy();
27
            }
28
            boolean value = MathUtils.compareTo(getDouble(op2, 1),getDouble(op2, 2),accuracy) >= 0;
29 29
            return value;
30 30
        }
31 31
        if( (type & TYPE_FLOAT) == TYPE_FLOAT ) {
32
            boolean value = MathUtils.compareTo(
33
                ((Number) op1).floatValue(), 
34
                ((Number) op2).floatValue(),
35
                interpreter.getAccuracy()==null? MathUtils.EPSILON:interpreter.getAccuracy()
36
            ) >= 0;
32
            double accuracy = MathUtils.EPSILON;
33
            if( interpreter.getAccuracy()!=null ) {
34
              accuracy = interpreter.getAccuracy();
35
            }
36
            boolean value = MathUtils.compareTo(getFloat(op1, 1),getFloat(op2, 2),accuracy) >= 0;
37 37
            return value;
38 38
        }
39 39
        if( (type & TYPE_LONG) == TYPE_LONG ) {
40
            boolean value = ((Number) op1).longValue() >= ((Number) op2).longValue();
40
            boolean value = Long.compare(getLong(op1, 1),getLong(op2, 2)) >= 0;
41 41
            return value;
42 42
        }
43 43
        if( (type & TYPE_INT) == TYPE_INT ) {
44
            boolean value = ((Number) op1).intValue() >= ((Number) op2).intValue();
44
            boolean value = Integer.compare(getInt(op1, 1),getInt(op2, 2)) >= 0;
45 45
            return value;
46
        }        
46
        }
47 47
        if( op2 instanceof Comparable && op2 instanceof Comparable ) {
48
            boolean value = ObjectUtils.compare((Comparable)op1,(Comparable)op2) >= 0;
48
            boolean value =   getComparable(op1,1).compareTo(getComparable(op2,2)) >= 0;
49 49
            return value;
50 50
        }
51 51
        throw new IllegalArgumentException("Types not allowed in '"+name()+"' operand.");

Also available in: Unified diff