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 acosfunction 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 number = (Number ) object; 24 return new FieldLiteral(new Double (Math.acos(number.doubleValue())), Datatype.DOUBLE); 25 } 26 throw new DException("DSE4108", new Object [] {StaticClass.getDataTypeName(type), "ACOS"}); 27 40 } 41 42 71 72 public AbstractRowValueExpression[] getChilds() { 73 AbstractRowValueExpression[] childs = new AbstractRowValueExpression[] {_parennumericvalueexpression0}; 74 return childs; 75 } 76 77 public String getType() throws DException { 78 return (String ) _SNONRESERVEDWORD1364442551.run(null); 79 } 80 81 public String toString() { 82 StringBuffer sb = new StringBuffer (); 83 sb.append(" "); 84 sb.append(_SNONRESERVEDWORD1364442551); 85 sb.append(_parennumericvalueexpression0); 86 return sb.toString(); 87 } 88 89 public Object clone() throws CloneNotSupportedException { 90 acosfunction tempClass = new acosfunction(); 91 tempClass._parennumericvalueexpression0 = (parennumericvalueexpression) _parennumericvalueexpression0.clone(); 92 tempClass._SNONRESERVEDWORD1364442551 = (SNONRESERVEDWORD136444255) _SNONRESERVEDWORD1364442551.clone(); 93 return tempClass; 94 } 95 96 public ParameterInfo[] getParameterInfo() throws DException { 97 ParameterInfo[] paramInfo = super.getParameterInfo(); 98 for (int i = 0; i < paramInfo.length; i++) { 99 if (paramInfo[i].getQuestionMark()) { 100 paramInfo[i].setDataType(Datatypes.DOUBLE); 101 paramInfo[i].setName("ACOS Arg"); 102 } 103 } 104 return paramInfo; 105 } 106 public ByteComparison getByteComparison(Object object) throws DException { 107 ByteComparison byteComparison = new ByteComparison(false, new int[] {DOUBLE}); 108 byteComparison.setSize(getColumnSize(object)); 109 return byteComparison; 110 } 111 112 public _Reference[] checkSemantic(_ServerSession parent) throws DException { 113 _Reference[] ref = super.checkSemantic(parent); 114 if(ref!=null) { 115 return ref; 116 } 117 int type = _parennumericvalueexpression0.getByteComparison(parent).getDataTypes()[0]; 118 if (type == -1 || type <= 15) { 119 return ref; 120 } 121 throw new DException("DSE4108", new Object [] {StaticClass.getDataTypeName(type), "ACOS"}); 122 123 } 124 125 public int getColumnSize(Object object) throws DException { 126 return Datatypes.DOUBLESIZE; 127 } 128 } 129 | Popular Tags |