Revision 13444 trunk/extensions/extExpressionField/src/com/iver/cit/gvsig/project/documents/table/operators/Acos.java

View differences:

Acos.java
3 3
import org.apache.bsf.BSFException;
4 4
import org.apache.bsf.BSFManager;
5 5

  
6
import com.iver.cit.gvsig.ExpresionFieldExtension;
6
import com.iver.andami.PluginServices;
7
import com.iver.cit.gvsig.ExpressionFieldExtension;
7 8
import com.iver.cit.gvsig.project.documents.table.AbstractOperator;
8 9
import com.iver.cit.gvsig.project.documents.table.IOperator;
9 10

  
......
19 20
		return "acos";
20 21
	}
21 22
	public void eval(BSFManager interpreter) throws BSFException {
22
		interpreter.eval(ExpresionFieldExtension.BEANSHELL,null,-1,-1,"double acos(double value){return java.lang.Math.acos(value);};");
23
		interpreter.exec(ExpressionFieldExtension.JYTHON, null, -1, -1,
24
	            "def acos(value):\n" +
25
	            "  import java.lang.Math\n"+
26
	            "  return java.lang.Math.acos(value)\n");
27
//		interpreter.eval(ExpressionFieldExtension.BEANSHELL,null,-1,-1,"double acos(double value){return java.lang.Math.acos(value);};");
23 28
	}
24 29
	public boolean isEnable() {
25 30
		return (getType()==IOperator.NUMBER);
26 31
	}
27

  
32
	public String getDescription() {
33
        return PluginServices.getText(this, "parameter") + ": " +
34
        PluginServices.getText(this, "numeric_value") + "\n" +
35
        PluginServices.getText(this, "returns") + ": " +
36
        PluginServices.getText(this, "numeric_value") + "\n" +
37
        PluginServices.getText(this, "description") + ": " +
38
        "Returns the arc cosine of an angle, in the range of 0.0 through pi. Special case:\n" +
39
        "* If the argument is NaN or its absolute value is greater than 1, then the result is NaN.";
40
    }
28 41
}

Also available in: Unified diff