root / trunk / extensions / extCAD / src / com / iver / cit / gvsig / project / documents / table / operators / Pow.java @ 10254
History | View | Annotate | Download (820 Bytes)
1 |
package com.iver.cit.gvsig.project.documents.table.operators; |
---|---|
2 |
|
3 |
import org.apache.bsf.BSFException; |
4 |
import org.apache.bsf.BSFManager; |
5 |
|
6 |
import com.iver.cit.gvsig.ExpresionFieldExtension; |
7 |
import com.iver.cit.gvsig.project.documents.table.AbstractOperator; |
8 |
import com.iver.cit.gvsig.project.documents.table.IOperator; |
9 |
|
10 |
/**
|
11 |
* @author Vicente Caballero Navarro
|
12 |
*/
|
13 |
public class Pow extends AbstractOperator{ |
14 |
|
15 |
public String addText(String s) { |
16 |
return toString()+"("+s+", \"\")"; |
17 |
} |
18 |
|
19 |
public void eval(BSFManager interpreter) throws BSFException { |
20 |
interpreter.eval(ExpresionFieldExtension.BEANSHELL,null,-1,-1,"double pow(double value1,double value2){return java.lang.Math.pow(value1,value2);};"); |
21 |
} |
22 |
public String toString() { |
23 |
return "pow"; |
24 |
} |
25 |
public boolean isEnable() { |
26 |
return (getType()==IOperator.NUMBER);
|
27 |
} |
28 |
} |