1 package com.daffodilwoods.daffodildb.server.sql99.expression; 2 3 import com.daffodilwoods.daffodildb.server.sql99.expression.rowvalueexpression.*; 4 import com.daffodilwoods.daffodildb.server.sql99.utils.*; 5 import com.daffodilwoods.daffodildb.utils.field.*; 6 import com.daffodilwoods.database.resource.*; 7 8 public abstract class AbstractValueExpression extends AbstractRowValueExpression implements rowvalueexpression, valueexpression { 9 10 public byte[][] getByte(_VariableValues variableValues) throws DException { 11 12 throw new java.lang.UnsupportedOperationException ("Method getBytes() not yet implemented."); 13 } 14 15 public Object getObject(_VariableValues variableValues) throws DException { 16 17 throw new java.lang.UnsupportedOperationException ("Method getObject() not yet implemented."); 18 } 19 20 21 public int getCardinality() throws DException { 22 initializeChildren(); 23 if (childs.length == 0) { 24 ; return 0; 26 } 27 int cardinality = childs[0].getCardinality(); 28 if (cardinality == -1) { 29 return cardinality; 30 } 31 for (int i = 1; i < childs.length; i++) { 32 if (childs[i] == null) { 33 continue; 34 } 35 int newCardinality = childs[i].getCardinality(); 36 if (newCardinality == -1) { 37 return newCardinality; 38 } 39 if (cardinality != newCardinality) { 40 ; throw new DException("DSE214", null); 42 } 43 } 44 return cardinality; 45 } 46 47 public Object clone() throws CloneNotSupportedException { 48 throw new CloneNotSupportedException (); 49 } 50 51 protected int getDataType(FieldBase fieldBase) throws DException { 52 int dataType = fieldBase.getDatatype(); 53 if (dataType == -1) { 54 fieldBase.setDatatype( -1); 55 dataType = fieldBase.getDatatype(); 56 } 57 return dataType; 58 } 59 } 60 | Popular Tags |