public final class InternCache
extends java.util.LinkedHashMap<java.lang.String,java.lang.String>
Note: that this class extends LinkedHashMap
is an implementation
detail -- no code should ever directly call Map methods.
Modifier and Type | Field and Description |
---|---|
private static int |
DEFAULT_SIZE
Let's create cache big enough to usually have enough space for
all entries...
|
private static int |
MAX_SIZE
Let's limit to hash area size of 1024.
|
private static InternCache |
sInstance |
Modifier | Constructor and Description |
---|---|
private |
InternCache() |
Modifier and Type | Method and Description |
---|---|
static InternCache |
getInstance() |
java.lang.String |
intern(java.lang.String input) |
protected boolean |
removeEldestEntry(java.util.Map.Entry<java.lang.String,java.lang.String> eldest) |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
private static final int DEFAULT_SIZE
private static final int MAX_SIZE
private static final InternCache sInstance
public static InternCache getInstance()
public java.lang.String intern(java.lang.String input)
protected boolean removeEldestEntry(java.util.Map.Entry<java.lang.String,java.lang.String> eldest)
removeEldestEntry
in class java.util.LinkedHashMap<java.lang.String,java.lang.String>