1 package com.daffodilwoods.daffodildb.server.sql99.utils; 2 3 import com.daffodilwoods.daffodildb.server.sql99.common.*; 4 import com.daffodilwoods.daffodildb.server.sql99.expression.booleanvalueexpression.*; 5 import com.daffodilwoods.database.resource.*; 6 7 public class ConditionVariableValue implements _IndexPredicate, java.io.Serializable { 8 9 booleanvalueexpression condition; 10 _VariableValues variableValues; 11 NestedVariableValues nestedVariableValue; 12 13 public ConditionVariableValue() { 14 } 15 16 public ConditionVariableValue(_VariableValues variableValues, booleanvalueexpression condition) { 17 this.variableValues = variableValues; 18 this.condition = condition; 19 } 20 21 public void setVariableValues(_Reference[] references, Object [] values, int priority) throws DException { 22 variableValues.setConditionVariableValue(references, values, priority); 23 if (nestedVariableValue != null) { 24 nestedVariableValue.setConditionVariableValue(references, values, priority); 25 } 26 } 27 28 public booleanvalueexpression getCondition() throws DException { 29 return condition; 30 } 31 32 public _VariableValues getVariableValues() throws DException { 33 return variableValues; 34 } 35 36 public void setVariableValues(_VariableValues variableValues) throws DException { 37 this.variableValues = variableValues; 38 } 39 40 public Object run() throws DException { 41 return condition.run(variableValues); 42 } 43 44 public Object run(Object object) throws DException { 45 try { 46 nestedVariableValue.setBTreeReader( (_VariableValues) object); 47 return nestedVariableValue.run(); 48 } catch (NullPointerException de) { 49 nestedVariableValue = new NestedVariableValues( (_VariableValues) object, variableValues, condition); 50 return nestedVariableValue.run(); 51 } 52 } 53 54 public _Reference[] getReferences(TableDetails[] parm1) throws com.daffodilwoods.database.resource.DException { 55 56 throw new java.lang.UnsupportedOperationException ("Method getReferences() not yet implemented."); 57 } 58 59 public String toString() { 60 String str = "CONDITIONVARIABLEVALUE"; 61 str += "[" + condition + "]"; 62 str += "[" + variableValues+ "]"; 63 return str; 64 } 65 66 public void releaseResource() throws DException { 67 variableValues.releaseResource(); 68 condition.releaseResource(); 69 } 70 71 public String toString1() { 72 return " ConditionVariableValues [ condition :: " + condition + " " + variableValues + "]"; 73 } 74 } 75 | Popular Tags |