Statistics
| Revision:

root / trunk / libraries / libExpressions / src / main / java / org / gvsig / operators / Acos.java @ 23299

History | View | Annotate | Download (1.31 KB)

1
package org.gvsig.operators;
2

    
3
import org.apache.bsf.BSFException;
4
import org.apache.bsf.BSFManager;
5
import org.gvsig.baseclasses.AbstractOperator;
6
import org.gvsig.baseclasses.IOperator;
7
import org.gvsig.expresions.EvalOperatorsTask;
8

    
9
/**
10
 * @author Vicente Caballero Navarro
11
 */
12
public class Acos extends AbstractOperator{
13

    
14
        public String addText(String s) {
15
                return toString()+"("+s+")";
16
        }
17
        public String toString() {
18
                return "acos";
19
        }
20
        public void eval(BSFManager interpreter) throws BSFException {
21
                interpreter.exec(EvalOperatorsTask.JYTHON, null, -1, -1,
22
                    "def acos(value):\n" +
23
                    "  import java.lang.Math\n"+
24
                    "  return java.lang.Math.acos(value)\n");
25
//                interpreter.eval(ExpressionFieldExtension.BEANSHELL,null,-1,-1,"double acos(double value){return java.lang.Math.acos(value);};");
26
        }
27
        public boolean isEnable() {
28
                return (getType()==IOperator.NUMBER);
29
        }
30
        public String getDescription() {
31
        return  "parameter" + ": " +
32
        "numeric_value" + "\n" +
33
        "returns" + ": " +
34
        "numeric_value" + "\n" +
35
        "description" + ": " +
36
        "Returns the arc cosine of an angle, in the range of 0.0 through pi. Special case:\n" +
37
        "* If the argument is NaN or its absolute value is greater than 1, then the result is NaN.";
38
    }
39
}