KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > expression > AbstractValueExpression


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       /**@todo Implement this com.daffodilwoods.daffodildb.server.sql99.expression.valueexpression method*/
12       throw new java.lang.UnsupportedOperationException JavaDoc("Method getBytes() not yet implemented.");
13    }
14
15    public Object JavaDoc getObject(_VariableValues variableValues) throws DException {
16       /**@todo Implement this com.daffodilwoods.daffodildb.server.sql99.expression.valueexpression method*/
17       throw new java.lang.UnsupportedOperationException JavaDoc("Method getObject() not yet implemented.");
18    }
19
20
21    public int getCardinality() throws DException {
22       initializeChildren();
23       if (childs.length == 0) {
24          ;//// Removed By Program ** System.out.println("Inside AbstractRowValueExpression : " + getClass());
25
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          ;//// Removed By Program ** System.out.println("Inside AbstractRowVAlueExpression : CArdinality1 = " + cardinality + " " + newCardinality + " Clas = " + this.getClass());
41
throw new DException("DSE214", null);
42          }
43       }
44       return cardinality;
45    }
46
47    public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
48       throw new CloneNotSupportedException JavaDoc();
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