1 22 23 package org.xquark.extractor.algebra; 24 25 import org.xquark.extractor.common.SqlWrapperException; 26 import org.xquark.extractor.sql.SqlExpression; 27 28 29 public class TempValue extends UnaryOperator { 30 31 private static final String RCSRevision = "$Revision: 1.4 $"; 32 private static final String RCSName = "$Name: $"; 33 34 35 Literal _value = null; 36 37 public TempValue() { 38 } 39 40 public TempValue(Expression operand) { 41 super(operand); 42 } 43 44 public boolean replaceChild(Expression oldChild, Expression newChild) 45 { 46 48 boolean retVal = false; 49 if (getOperand() == oldChild) { 50 setOperand(newChild); 51 retVal = true; 52 } 53 54 return retVal; 56 } 57 58 public void setValue(Literal value) { 59 _value = value; 60 } 61 62 public Literal getValue() { 63 return _value; 64 } 65 66 public SqlExpression accept (GenSqlVisitor visitor) throws SqlWrapperException 67 { 68 return visitor.visit(this); 69 } 70 71 public void accept (AlgebraVisitor visitor) throws SqlWrapperException 72 { 73 visitor.visit(this); 74 } 75 76 79 public boolean deepEquals(Object o) 80 { 81 if (o instanceof TempValue) 82 { 83 TempValue cast = (TempValue)o; 84 return super.deepEquals(o) && _value.equals(cast.getValue()); 85 } 86 return false; 87 } 88 } 89 | Popular Tags |