1 29 30 package com.caucho.quercus.env; 31 32 import com.caucho.quercus.Quercus; 33 34 37 public final class InternStringValue extends StringValueImpl { 38 private final int _hashCode; 39 private final Value _key; 40 private final int _type; 41 42 public InternStringValue(String value) 43 { 44 super(value.intern()); 45 46 _hashCode = super.hashCode(); 47 _key = super.toKey(); 48 _type = super.getNumericType(); 49 } 50 51 54 public InternStringValue intern(Quercus quercus) 55 { 56 return this; 57 } 58 59 62 public final boolean isLong() 63 { 64 return _type == IS_LONG; 65 } 66 67 70 public final boolean isDouble() 71 { 72 return _type == IS_DOUBLE; 73 } 74 75 78 @Override 79 public final boolean isNumber() 80 { 81 return _type != IS_STRING; 82 } 83 84 87 protected int getNumericType() 88 { 89 return _type; 90 } 91 92 95 public final Value toKey() 96 { 97 return _key; 98 } 99 100 103 public final int hashCode() 104 { 105 return _hashCode; 106 } 107 108 public String toInternString() 109 { 110 return toString(); 111 } 112 } 113 114 | Popular Tags |