org.eclipse.internal.xtend.util
Class QualifiedNameWithDelimiter.StringCache

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by org.eclipse.internal.xtend.util.WeakInterningHashSet<java.lang.String>
              extended by org.eclipse.internal.xtend.util.QualifiedNameWithDelimiter.StringCache
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<java.lang.String>, java.util.Collection<java.lang.String>, java.util.Set<java.lang.String>
Enclosing class:
QualifiedNameWithDelimiter

protected static class QualifiedNameWithDelimiter.StringCache
extends WeakInterningHashSet<java.lang.String>

A cached pool of weakly referenced strings. When adding a new string, this pool will always cache a new minimally sized string.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.internal.xtend.util.WeakInterningHashSet
WeakInterningHashSet.Entry<E>
 
Field Summary
protected  char[] buffer
          A buffer for processing characters to avoid so many calls to String.charAt(int).
 
Fields inherited from class org.eclipse.internal.xtend.util.WeakInterningHashSet
CAPACITY_MASK, entries, MOD_COUNT_INCREMENT, modCount, NULL_BIT_INCREMENT, NULL_ENTRY, PRIME_CAPACITIES, queue, size
 
Constructor Summary
protected QualifiedNameWithDelimiter.StringCache()
           
 
Method Summary
protected  WeakInterningHashSet.Entry<java.lang.String> createEntry(java.lang.String object, int hashCode)
          Creates a new entry for the given referent and the given hash code.
protected  java.lang.String intern(char[] characters, int offset, int count, int hashCode)
          Returns the interned string for the given character range and its hash code, which must be equivalent to what's computed by String.hashCode().
 java.lang.String intern(java.lang.String object)
           
 
Methods inherited from class org.eclipse.internal.xtend.util.WeakInterningHashSet
add, addEntry, cleanup, contains, dump, ensureCapacity, equals, get, getEntry, grow, hashCode, index, iterator, newEntries, nullEntry, putEntry, rehash, remove, removeEntry, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray
 

Field Detail

buffer

protected char[] buffer
A buffer for processing characters to avoid so many calls to String.charAt(int).

Constructor Detail

QualifiedNameWithDelimiter.StringCache

protected QualifiedNameWithDelimiter.StringCache()
Method Detail

intern

protected java.lang.String intern(char[] characters,
                                  int offset,
                                  int count,
                                  int hashCode)
Returns the interned string for the given character range and its hash code, which must be equivalent to what's computed by String.hashCode().


intern

public java.lang.String intern(java.lang.String object)
Overrides:
intern in class WeakInterningHashSet<java.lang.String>

createEntry

protected WeakInterningHashSet.Entry<java.lang.String> createEntry(java.lang.String object,
                                                                   int hashCode)
Description copied from class: WeakInterningHashSet
Creates a new entry for the given referent and the given hash code.

Overrides:
createEntry in class WeakInterningHashSet<java.lang.String>