1 19 20 25 26 27 28 29 30 package soot.jimple; 31 32 import soot.*; 33 import soot.util.*; 34 import java.util.*; 35 36 public class StringConstant extends Constant 37 { 38 public final String value; 39 40 private StringConstant(String s) 41 { 42 this.value = s; 43 } 44 45 public static StringConstant v(String value) 46 { 47 return new StringConstant(value); 48 } 49 50 public boolean equals(Object c) 52 { 53 return (c instanceof StringConstant && ((StringConstant) c).value.equals(this.value)); 54 } 55 56 57 public int hashCode() 58 { 59 return value.hashCode(); 60 } 61 62 public String toString() 63 { 64 return StringTools.getQuotedStringOf(value); 65 } 66 67 public Type getType() 68 { 69 return RefType.v("java.lang.String"); 70 } 71 72 public void apply(Switch sw) 73 { 74 ((ConstantSwitch) sw).caseStringConstant(this); 75 } 76 } 77 | Popular Tags |