1 22 23 package org.xquark.extractor.algebra; 24 25 import java.util.Map ; 26 27 import org.xquark.extractor.common.SqlWrapperException; 28 import org.xquark.extractor.sql.SqlExpression; 29 30 public final class LitDouble extends Literal 31 { 32 33 private static final String RCSRevision = "$Revision: 1.4 $"; 34 private static final String RCSName = "$Name: $"; 35 36 private Double _value; 37 38 42 public LitDouble(Double value) 43 { 44 _value = value ; 45 } 46 47 public LitDouble(double value) 48 { 49 _value = new Double (value) ; 50 } 51 52 61 synchronized Object clone(Map clonedExprs) throws CloneNotSupportedException 62 { 63 65 LitDouble retVal = (LitDouble)super.clone(clonedExprs); 66 retVal.setValue((getValue() == null) ? null : new Double (getValue().doubleValue())); 67 68 clonedExprs.put(this, retVal); 69 return retVal; 71 } 72 73 78 public Double getValue() 79 { 80 return _value; 81 } 82 83 88 public void setValue(Double aValue) 89 { 90 _value = aValue; 91 } 92 93 public String pprint() 94 { 95 return _value.toString(); 96 } 97 98 public SqlExpression accept (GenSqlVisitor visitor) throws SqlWrapperException 99 { 100 return visitor.visit(this); 101 } 102 103 public void accept (AlgebraVisitor visitor) throws SqlWrapperException 104 { 105 visitor.visit(this); 106 } 107 108 111 public boolean deepEquals(Object o) 112 { 113 if (o instanceof LitDouble) 114 { 115 LitDouble cast = (LitDouble)o; 116 return _value.equals(cast.getValue()); 117 } 118 return false; 119 } 120 } 121 | Popular Tags |