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