1 22 23 24 package org.xquark.extractor.algebra; 25 26 import java.math.BigDecimal ; 27 import java.util.Map ; 28 29 import org.xquark.extractor.common.SqlWrapperException; 30 import org.xquark.extractor.sql.SqlExpression; 31 32 public final class LitDecimal extends Literal 33 { 34 35 private static final String RCSRevision = "$Revision: 1.4 $"; 36 private static final String RCSName = "$Name: $"; 37 38 private BigDecimal _value; 39 40 41 public LitDecimal(BigDecimal value) 42 { 43 _value = value ; 44 } 45 46 synchronized Object clone(Map clonedExprs) throws CloneNotSupportedException 47 { 48 50 LitDecimal retVal = (LitDecimal)super.clone(clonedExprs); 51 retVal.setValue((getValue() == null) ? null : new BigDecimal (getValue().toString())); 52 53 clonedExprs.put(this, retVal); 54 return retVal; 56 } 57 58 public BigDecimal getValue() 59 { 60 return _value; 61 } 62 63 public void setValue(BigDecimal aValue) 64 { 65 _value = aValue; 66 } 67 68 69 public String pprint ( ) 70 { 71 return _value.toString ( ) ; 72 } 73 74 public SqlExpression accept (GenSqlVisitor visitor) throws SqlWrapperException 75 { 76 return visitor.visit(this); 77 } 78 79 public void accept (AlgebraVisitor visitor) throws SqlWrapperException 80 { 81 visitor.visit(this); 82 } 83 84 87 public boolean deepEquals(Object o) 88 { 89 if (o instanceof LitDecimal) 90 { 91 LitDecimal cast = (LitDecimal)o; 92 return _value.equals(cast.getValue()); 93 } 94 return false; 95 } 96 } 97 | Popular Tags |