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 expfunction 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, DOUBLE); 21 } 22 if (type <= 15) { 23 return new FieldLiteral(new Double (Math.exp( ( (Number ) object).doubleValue())), Datatype.DOUBLE); 24 } 25 throw new DException("DSE4108", new Object [] {StaticClass.getDataTypeName(type), "EXP"}); 26 39 40 } 41 42 70 71 public AbstractRowValueExpression[] getChilds() { 72 AbstractRowValueExpression[] childs = new AbstractRowValueExpression[] {_parennumericvalueexpression0}; 73 return childs; 74 } 75 76 public String getType() throws DException { 77 return (String ) _SNONRESERVEDWORD1364442551.run(null); 78 } 79 80 public String toString() { 81 StringBuffer sb = new StringBuffer (); 82 sb.append(" "); 83 sb.append(_SNONRESERVEDWORD1364442551); 84 sb.append(_parennumericvalueexpression0); 85 return sb.toString(); 86 } 87 88 public Object clone() throws CloneNotSupportedException { 89 expfunction tempClass = new expfunction(); 90 tempClass._parennumericvalueexpression0 = (parennumericvalueexpression) _parennumericvalueexpression0.clone(); 91 tempClass._SNONRESERVEDWORD1364442551 = (SNONRESERVEDWORD136444255) _SNONRESERVEDWORD1364442551.clone(); 92 return tempClass; 93 } 94 95 public ParameterInfo[] getParameterInfo() throws DException { 96 ParameterInfo[] paramInfo = super.getParameterInfo(); 97 for (int i = 0; i < paramInfo.length; i++) { 98 if (paramInfo[i].getQuestionMark()) { 99 paramInfo[i].setDataType(Datatypes.DOUBLE); 100 paramInfo[i].setName("EXP Arg"); 101 } 102 } 103 return paramInfo; 104 } 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), "EXP"}); 122 } 123 public int getColumnSize(Object object) throws DException { 124 return Datatypes.DOUBLESIZE; 125 } 126 127 } 128 | Popular Tags |