1 package com.daffodilwoods.daffodildb.server.sql99.expression.numericvalueexpression; 2 3 import com.daffodilwoods.daffodildb.server.datasystem.interfaces.*; 4 import com.daffodilwoods.daffodildb.server.serversystem.*; 5 import com.daffodilwoods.daffodildb.server.sql99.common.*; 6 import com.daffodilwoods.daffodildb.server.sql99.expression.rowvalueexpression.*; 7 import com.daffodilwoods.daffodildb.server.sql99.token.*; 8 import com.daffodilwoods.daffodildb.server.sql99.utils.*; 9 import com.daffodilwoods.daffodildb.utils.*; 10 import com.daffodilwoods.daffodildb.utils.field.*; 11 import com.daffodilwoods.database.resource.*; 12 13 public class asinfunction extends AbstractNumericValueFunction { 14 15 public parennumericvalueexpression _parennumericvalueexpression0; 16 public SNONRESERVEDWORD136444255 _SNONRESERVEDWORD1364442551; 17 18 protected Object getResult(int type, Object object) throws DException { 19 if (object == null) { 20 return new FieldLiteral(FieldUtility.NULLBUFFERRANGE, Datatype.DOUBLE); 21 } 22 if (type <= 15) { 23 Number operand = (Number ) object; 24 return new FieldLiteral(new Double (Math.asin(operand.doubleValue())), 25 Datatype.DOUBLE); 26 } 27 throw new DException("DSE4108", new Object [] {StaticClass.getDataTypeName(type), "ASIN"}); 28 41 } 42 43 72 73 public AbstractRowValueExpression[] getChilds() { 74 AbstractRowValueExpression[] childs = new AbstractRowValueExpression[] {_parennumericvalueexpression0}; 75 return childs; 76 } 77 78 public String getType() throws DException { 79 return (String ) _SNONRESERVEDWORD1364442551.run(null); 80 } 81 82 public String toString() { 83 StringBuffer sb = new StringBuffer (); 84 sb.append(" "); 85 sb.append(_SNONRESERVEDWORD1364442551); 86 sb.append(_parennumericvalueexpression0); 87 return sb.toString(); 88 } 89 90 public Object clone() throws CloneNotSupportedException { 91 asinfunction tempClass = new asinfunction(); 92 tempClass._parennumericvalueexpression0 = (parennumericvalueexpression) _parennumericvalueexpression0.clone(); 93 tempClass._SNONRESERVEDWORD1364442551 = (SNONRESERVEDWORD136444255) _SNONRESERVEDWORD1364442551.clone(); 94 return tempClass; 95 } 96 97 public ParameterInfo[] getParameterInfo() throws DException { 98 ParameterInfo[] paramInfo = super.getParameterInfo(); 99 for (int i = 0; i < paramInfo.length; i++) { 100 if (paramInfo[i].getQuestionMark()) { 101 paramInfo[i].setDataType(Datatypes.DOUBLE); 102 paramInfo[i].setName("ASIN Arg"); 103 } 104 } 105 return paramInfo; 106 } 107 108 public ByteComparison getByteComparison(Object object) throws DException { 109 ByteComparison byteComparison= new ByteComparison(false, new int[] {Datatype.DOUBLE}); 110 byteComparison.setSize(getColumnSize(object)); 111 return byteComparison; 112 } 113 114 130 131 public _Reference[] checkSemantic(_ServerSession parent) throws DException { 132 _Reference[] ref = super.checkSemantic(parent); 133 if(ref!=null) { 134 return ref; 135 } 136 int type = _parennumericvalueexpression0.getByteComparison(parent).getDataTypes()[0]; 137 if (type == -1 || type <= 15) { 138 return ref; 139 } 140 throw new DException("DSE4108", new Object [] {StaticClass.getDataTypeName(type), "ACOS"}); 141 } 142 143 public int getColumnSize(Object object) throws DException { 144 return Datatypes.DOUBLESIZE; 145 } 146 147 } 148 | Popular Tags |