1 package com.daffodilwoods.daffodildb.server.sql99.token; 2 3 import com.daffodilwoods.daffodildb.server.datasystem.interfaces.*; 4 import com.daffodilwoods.daffodildb.server.sql99.common.*; 5 import com.daffodilwoods.daffodildb.server.sql99.expression.*; 6 import com.daffodilwoods.daffodildb.server.sql99.expression.rowvalueexpression.*; 7 import com.daffodilwoods.daffodildb.server.sql99.utils.*; 8 import com.daffodilwoods.daffodildb.utils.*; 9 import com.daffodilwoods.daffodildb.utils.byteconverter.*; 10 import com.daffodilwoods.daffodildb.utils.field.*; 11 import com.daffodilwoods.database.resource.*; 12 import com.daffodilwoods.daffodildb.server.serversystem._ServerSession; 13 14 public class timestampliteral extends AbstractValueExpression implements com.daffodilwoods.daffodildb.utils.parser.StatementExecuter, 15 datetimeliteral { 16 public timestampstring _timestampstring0; 17 public SRESERVEDWORD1206543922 _SRESERVEDWORD12065439221; 18 private java.sql.Timestamp identifier = null; 19 private FieldBase fieldBase; 20 21 24 public _Reference[] checkSemantic(_ServerSession parent) throws DException { 25 26 TypeValidityHandler.getTimeStampFromTimestampDate(( (FieldBase) _timestampstring0.run(null)).getObject().toString()); 27 return super.checkSemantic(parent); 28 } 29 30 public Object run(Object object) throws com.daffodilwoods.database.resource. 31 DException { 32 if (fieldBase == null) { 33 String s = ( (FieldBase) _timestampstring0.run(object)).getObject().toString(); 34 35 fieldBase = new FieldTimeStampLiteral(TypeValidityHandler.getTimeStampFromTimestampDate(s)); 36 } 37 return fieldBase; 38 } 39 40 ColumnDetails[] cd; 41 public ColumnDetails[] getColumnDetails() throws DException { 42 cd = _timestampstring0.getColumnDetails(); 43 cd[0].setDatatype(Datatypes.TIMESTAMP); 44 return cd; 45 } 46 47 public Object [] getParameters(Object object) throws DException { 48 return null; 49 } 50 51 public int getType() { 52 return OTHERS; 53 } 54 55 private byte[] getAppropriateBytes() throws DException { 56 int datatype = cd[0].getDatatype(); 57 switch (datatype) { 58 case Datatypes.TIMESTAMP: 59 return CCzufDpowfsufs.getBytes(identifier); 60 default: 61 throw new DException("DSE514", new Object [] {new Integer (datatype)}); 62 } 63 } 64 65 public AbstractRowValueExpression[] getChilds() { 66 AbstractRowValueExpression[] childs = new AbstractRowValueExpression[] {}; 67 return childs; 68 } 69 70 public ParameterInfo[] getParameterInfo() throws DException { 71 ParameterInfo parameterInfo = new ParameterInfo(); 72 parameterInfo.setDataType(Datatypes.TIMESTAMP); 73 return new ParameterInfo[] {parameterInfo}; 74 } 75 76 public String toString() { 77 StringBuffer sb = new StringBuffer (); 78 sb.append(" "); 79 sb.append(_SRESERVEDWORD12065439221); 80 sb.append(" "); 81 sb.append(_timestampstring0); 82 return sb.toString(); 83 } 84 85 public Object clone() throws CloneNotSupportedException { 86 timestampliteral tempClass = new timestampliteral(); 87 tempClass._timestampstring0 = (timestampstring) _timestampstring0.clone(); 88 tempClass._SRESERVEDWORD12065439221 = (SRESERVEDWORD1206543922) 89 _SRESERVEDWORD12065439221.clone(); 90 return tempClass; 91 } 92 93 public int getCardinality() throws DException { 94 return 1; 95 } 96 97 public ByteComparison getByteComparison(Object object) throws DException { 98 return new ByteComparison(false, new int[] {Datatype.TIMESTAMP}); 99 } 100 } 101 | Popular Tags |