Java 类org.codehaus.jackson.util.InternCache 实例源码

项目:12306-android-Decompile    文件:BytesToNameCanonicalizer.java   
public Name addName(String paramString, int paramInt1, int paramInt2)
{
  if (this._intern)
    paramString = InternCache.instance.intern(paramString);
  if (paramInt2 == 0);
  for (int i = calcHash(paramInt1); ; i = calcHash(paramInt1, paramInt2))
  {
    Name localName = constructName(i, paramString, paramInt1, paramInt2);
    _addSymbol(i, localName);
    return localName;
  }
}
项目:12306-android-Decompile    文件:BytesToNameCanonicalizer.java   
public Name addName(String paramString, int[] paramArrayOfInt, int paramInt)
{
  if (this._intern)
    paramString = InternCache.instance.intern(paramString);
  int i = calcHash(paramArrayOfInt, paramInt);
  Name localName = constructName(i, paramString, paramArrayOfInt, paramInt);
  _addSymbol(i, localName);
  return localName;
}
项目:12306-android-Decompile    文件:SettableBeanProperty.java   
protected SettableBeanProperty(String paramString, JavaType paramJavaType, TypeDeserializer paramTypeDeserializer, Annotations paramAnnotations)
{
  if ((paramString == null) || (paramString.length() == 0));
  for (this._propName = ""; ; this._propName = InternCache.instance.intern(paramString))
  {
    this._type = paramJavaType;
    this._contextAnnotations = paramAnnotations;
    this._valueTypeDeserializer = paramTypeDeserializer;
    return;
  }
}
项目:RHome    文件:BytesToNameCanonicalizer.java   
public Name addName(String symbolStr, int[] quads, int qlen)
{
    if (_intern) {
        symbolStr = InternCache.instance.intern(symbolStr);
    }
    int hash = calcHash(quads, qlen);
    Name symbol = constructName(hash, symbolStr, quads, qlen);
    _addSymbol(hash, symbol);
    return symbol;
}
项目:RHome    文件:SettableBeanProperty.java   
protected SettableBeanProperty(String propName, JavaType type,
        TypeDeserializer typeDeser)
{
    /* 09-Jan-2009, tatu: Intern()ing makes sense since Jackson parsed
     *   field names are (usually) interned too, hence lookups will be faster.
     */
    // 23-Oct-2009, tatu: should this be disabled wrt [JACKSON-180]?
    if (propName == null || propName.length() == 0) {
        _propName = "";
    } else {
        _propName = InternCache.instance.intern(propName);
    }
    _type = type;
    _valueTypeDeserializer = typeDeser;
}
项目:12306-android-Decompile    文件:BytesToNameCanonicalizer.java   
public Name addName(String paramString, int paramInt1, int paramInt2)
{
  if (this._intern)
    paramString = InternCache.instance.intern(paramString);
  if (paramInt2 == 0);
  for (int i = calcHash(paramInt1); ; i = calcHash(paramInt1, paramInt2))
  {
    Name localName = constructName(i, paramString, paramInt1, paramInt2);
    _addSymbol(i, localName);
    return localName;
  }
}
项目:12306-android-Decompile    文件:BytesToNameCanonicalizer.java   
public Name addName(String paramString, int[] paramArrayOfInt, int paramInt)
{
  if (this._intern)
    paramString = InternCache.instance.intern(paramString);
  int i = calcHash(paramArrayOfInt, paramInt);
  Name localName = constructName(i, paramString, paramArrayOfInt, paramInt);
  _addSymbol(i, localName);
  return localName;
}
项目:12306-android-Decompile    文件:SettableBeanProperty.java   
protected SettableBeanProperty(String paramString, JavaType paramJavaType, TypeDeserializer paramTypeDeserializer, Annotations paramAnnotations)
{
  if ((paramString == null) || (paramString.length() == 0));
  for (this._propName = ""; ; this._propName = InternCache.instance.intern(paramString))
  {
    this._type = paramJavaType;
    this._contextAnnotations = paramAnnotations;
    this._valueTypeDeserializer = paramTypeDeserializer;
    return;
  }
}
项目:ingress-indonesia-dev    文件:BytesToNameCanonicalizer.java   
public final Name addName(String paramString, int[] paramArrayOfInt, int paramInt)
{
  if (this._intern)
    paramString = InternCache.instance.intern(paramString);
  int i = calcHash(paramArrayOfInt, paramInt);
  Name localName = constructName(i, paramString, paramArrayOfInt, paramInt);
  _addSymbol(i, localName);
  return localName;
}
项目:ingress-indonesia-dev    文件:SettableBeanProperty.java   
protected SettableBeanProperty(String paramString, JavaType paramJavaType, TypeDeserializer paramTypeDeserializer, Annotations paramAnnotations)
{
  if ((paramString == null) || (paramString.length() == 0));
  for (this._propName = ""; ; this._propName = InternCache.instance.intern(paramString))
  {
    this._type = paramJavaType;
    this._contextAnnotations = paramAnnotations;
    this._valueTypeDeserializer = paramTypeDeserializer;
    return;
  }
}
项目:RHome    文件:CharsToNameCanonicalizer.java   
public String findSymbol(char[] buffer, int start, int len, int hash)
{
    if (len < 1) { // empty Strings are simplest to handle up front
        return "";
    }
    if (!_canonicalize) { // [JACKSON-259]
        return new String(buffer, start, len);
    }

    hash &= _indexMask;

    String sym = _symbols[hash];

    // Optimal case; checking existing primary symbol for hash index:
    if (sym != null) {
        // Let's inline primary String equality checking:
        if (sym.length() == len) {
            int i = 0;
            do {
                if (sym.charAt(i) != buffer[start+i]) {
                    break;
                }
            } while (++i < len);
            // Optimal case; primary match found
            if (i == len) {
                return sym;
            }
        }
        // How about collision bucket?
        Bucket b = _buckets[hash >> 1];
        if (b != null) {
            sym = b.find(buffer, start, len);
            if (sym != null) {
                return sym;
            }
        }
    }

    if (!_dirty) { //need to do copy-on-write?
        copyArrays();
        _dirty = true;
    } else if (_size >= _sizeThreshold) { // Need to expand?
       rehash();
        /* Need to recalc hash; rare occurence (index mask has been
         * recalculated as part of rehash)
         */
        hash = calcHash(buffer, start, len) & _indexMask;
    }
    ++_size;

    String newSymbol = new String(buffer, start, len);
    if (_intern) {
        newSymbol = InternCache.instance.intern(newSymbol);
    }
    // Ok; do we need to add primary entry, or a bucket?
    if (_symbols[hash] == null) {
        _symbols[hash] = newSymbol;
    } else {
        int bix = hash >> 1;
        _buckets[bix] = new Bucket(newSymbol, _buckets[bix]);
    }

    return newSymbol;
}
项目:ingress-indonesia-dev    文件:CharsToNameCanonicalizer.java   
public final String findSymbol(char[] paramArrayOfChar, int paramInt1, int paramInt2, int paramInt3)
{
  if (paramInt2 <= 0)
    return "";
  if (!this._canonicalize)
    return new String(paramArrayOfChar, paramInt1, paramInt2);
  int i = paramInt3 & this._indexMask;
  String str1 = this._symbols[i];
  if (str1 != null)
  {
    if (str1.length() == paramInt2)
    {
      int m = 0;
      do
      {
        if (str1.charAt(m) != paramArrayOfChar[(paramInt1 + m)])
          break;
        m++;
      }
      while (m < paramInt2);
      if (m == paramInt2)
        return str1;
    }
    CharsToNameCanonicalizer.Bucket localBucket = this._buckets[(i >> 1)];
    if (localBucket != null)
    {
      String str3 = localBucket.find(paramArrayOfChar, paramInt1, paramInt2);
      if (str3 != null)
        return str3;
    }
  }
  int j;
  if (!this._dirty)
  {
    copyArrays();
    this._dirty = true;
    j = i;
  }
  while (true)
  {
    this._size = (1 + this._size);
    String str2 = new String(paramArrayOfChar, paramInt1, paramInt2);
    if (this._intern)
      str2 = InternCache.instance.intern(str2);
    if (this._symbols[j] == null)
    {
      this._symbols[j] = str2;
      return str2;
      if (this._size >= this._sizeThreshold)
      {
        rehash();
        j = calcHash(paramArrayOfChar, paramInt1, paramInt2) & this._indexMask;
      }
    }
    else
    {
      int k = j >> 1;
      this._buckets[k] = new CharsToNameCanonicalizer.Bucket(str2, this._buckets[k]);
      return str2;
      j = i;
    }
  }
}