com.ctc.wstx.util
Class InternCache
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap
com.ctc.wstx.util.InternCache
- All Implemented Interfaces:
- Serializable, Cloneable, Map
public final class InternCache
- extends LinkedHashMap
Singleton class that implements "fast intern" functionality, essentially
adding a layer that caches Strings that have been previously intern()ed,
but that probably shouldn't be added to symbol tables.
This is usually used by improving intern()ing of things like namespace
URIs.
Note: that this class extends LinkedHashMap
is an implementation
detail -- no code should ever directly call Map methods.
- See Also:
- Serialized Form
Methods inherited from interface java.util.Map |
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
getInstance
public static InternCache getInstance()
intern
public String intern(String input)
removeEldestEntry
protected boolean removeEldestEntry(Map.Entry eldest)
- Overrides:
removeEldestEntry
in class LinkedHashMap