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 LitFloat extends Literal 31 { 32 33 private static final String RCSRevision = "$Revision: 1.4 $"; 34 private static final String RCSName = "$Name: $"; 35 36 private Float _value; 37 38 42 public LitFloat(Float value) 43 { 44 _value = value ; 45 } 46 47 public LitFloat(float value) 48 { 49 _value = new Float (value) ; 50 } 51 52 61 synchronized Object clone(Map clonedExprs) throws CloneNotSupportedException 62 { 63 65 LitFloat retVal = (LitFloat)super.clone(clonedExprs); 66 retVal.setValue((getValue() == null) ? null : new Float (getValue().floatValue())); 67 68 clonedExprs.put(this, retVal); 69 return retVal; 71 } 72 73 78 public Float getValue() 79 { 80 return _value; 81 } 82 83 88 public void setValue(Float 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 LitFloat) 114 { 115 LitFloat cast = (LitFloat)o; 116 return _value.equals(cast.getValue()); 117 } 118 return false; 119 } 120 } 121 | Popular Tags |