org.eclipse.internal.xtend.util
Class QualifiedNameWithDelimiter.StringCache
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
org.eclipse.internal.xtend.util.WeakInterningHashSet<java.lang.String>
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
Field Summary |
protected char[] |
buffer
A buffer for processing characters to avoid so many calls to String.charAt(int) . |
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 |
buffer
protected char[] buffer
- A buffer for processing characters to avoid so many calls to
String.charAt(int)
.
QualifiedNameWithDelimiter.StringCache
protected QualifiedNameWithDelimiter.StringCache()
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>