com.ctc.wstx.util
Class InternCache

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap
              extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Method Summary
static InternCache getInstance()
           
 String intern(String input)
           
protected  boolean removeEldestEntry(Map.Entry eldest)
           
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get
 
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

getInstance

public static InternCache getInstance()

intern

public String intern(String input)

removeEldestEntry

protected boolean removeEldestEntry(Map.Entry eldest)
Overrides:
removeEldestEntry in class LinkedHashMap


Copyright © 2011 Codehaus. All Rights Reserved.