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 LitString extends Literal 31 { 32 private static final String RCSRevision = "$Revision: 1.4 $"; 33 private static final String RCSName = "$Name: $"; 34 private String _value; 35 36 40 public LitString(String value) 41 { 42 _value = value ; 43 } 44 45 46 47 synchronized Object clone(Map clonedExprs) throws CloneNotSupportedException 48 { 49 51 LitString retVal = (LitString)super.clone(clonedExprs); 52 clonedExprs.put(this, retVal); 53 return retVal; 55 } 56 57 62 public String getValue() 63 { 64 return _value; 65 } 66 67 72 public void setValue(String aValue) 73 { 74 _value = aValue; 75 } 76 77 public String pprint ( ) 78 { 79 return "'" + _value + "'" ; 80 } 81 82 public SqlExpression accept (GenSqlVisitor visitor) throws SqlWrapperException 83 { 84 return visitor.visit(this); 85 } 86 87 public void accept (AlgebraVisitor visitor) throws SqlWrapperException 88 { 89 visitor.visit(this); 90 } 91 92 95 public boolean deepEquals(Object o) 96 { 97 if (o instanceof LitString) 98 { 99 LitString cast = (LitString)o; 100 return _value.equals(cast.getValue()); 101 } 102 return false; 103 } 104 } 105 | Popular Tags |