Package org.ka2ddo.util
Class StringCache
This singleton class provides a pruneable cache for constant Strings that won't
eat up the PermGen part of the Java JVM heap.
- Author:
- Andrew Pavlin, KA2DDO
-
Method Summary
Methods inherited from class org.ka2ddo.util.ShareableObjectCache
add, clear, internKey, isEmpty, iterator, remove, size, toString
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, retainAll, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
addAll, contains, containsAll, retainAll, spliterator, toArray, toArray
-
Method Details
-
intern
Return the interned singleton copy of the specified String. If the String does not currently exist in the StringCache, it becomes the singleton.- Parameters:
s
- String to look for interned copy- Returns:
- interned String copy
-
getType
Get data type of the objects stored in this ShareableObjectCache.- Specified by:
getType
in classShareableObjectCache<String>
- Returns:
- Class of stored objects
-