Class InternCache

All Implemented Interfaces:
Serializable, Cloneable, Map<String,String>

public final class InternCache extends LinkedHashMap<String,String>
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:
  • Field Details

    • DEFAULT_SIZE

      private static final int DEFAULT_SIZE
      Let'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_SIZE
      Let's limit to hash area size of 1024.
      See Also:
    • sInstance

      private static final InternCache sInstance
  • Constructor Details

    • InternCache

      private InternCache()
  • Method Details