Statistics
| Revision:

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

History | View | Annotate | Download (1.38 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 Asin extends AbstractOperator{
13

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