Package com.ctc.wstx.util
Class InternCache
java.lang.Object
com.ctc.wstx.util.InternCache
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intLet's create cache big enough to usually have enough space for all entries...private static final intLet's limit maximum size.private final ConcurrentHashMap<String, String> private final ConcurrentLinkedQueue<String> Queue tracking insertion order for FIFO eviction when the cache exceedsMAX_SIZE.private static final InternCache -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DEFAULT_SIZE
private static final int DEFAULT_SIZELet's create cache big enough to usually have enough space for all entries... (assuming NS URIs only)- See Also:
-
MAX_SIZE
private static final int MAX_SIZELet's limit maximum size.- See Also:
-
sInstance
-
mCache
-
mInsertionOrder
Queue tracking insertion order for FIFO eviction when the cache exceedsMAX_SIZE.
-
-
Constructor Details
-
InternCache
private InternCache()
-
-
Method Details
-
getInstance
-
intern
-