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 LitInteger extends Literal 31 { 32 33 private static final String RCSRevision = "$Revision: 1.4 $"; 34 private static final String RCSName = "$Name: $"; 35 36 private Integer _value; 37 38 39 public LitInteger(Integer value) 40 { 41 _value = value ; 42 } 43 44 public LitInteger(int value) 45 { 46 _value = new Integer (value) ; 47 } 48 49 58 synchronized Object clone(Map clonedExprs) throws CloneNotSupportedException 59 { 60 62 LitInteger retVal = (LitInteger)super.clone(clonedExprs); 63 retVal.setValue((getValue() == null) ? null : new Integer ( getValue().intValue())); 64 65 clonedExprs.put(this, retVal); 66 return retVal; 68 } 69 70 public Integer getValue() 71 { 72 return _value; 73 } 74 75 public void setValue(Integer aValue) 76 { 77 _value = aValue; 78 } 79 80 81 public String pprint ( ) 82 { 83 return _value.toString ( ) ; 84 } 85 86 public SqlExpression accept (GenSqlVisitor visitor) throws SqlWrapperException 87 { 88 return visitor.visit(this); 89 } 90 91 public void accept (AlgebraVisitor visitor) throws SqlWrapperException 92 { 93 visitor.visit(this); 94 } 95 96 99 public boolean deepEquals(Object o) 100 { 101 if (o instanceof LitInteger) 102 { 103 LitInteger cast = (LitInteger)o; 104 return _value.equals(cast.getValue()); 105 } 106 return false; 107 } 108 } 109 | Popular Tags |