Class StringCache


  • public class StringCache
    extends java.lang.Object
    An alternative to String.intern() with no capacity constraints.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int LENGTH_LIMIT  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String cachedValueOf​(java.lang.String str)  
      static java.lang.String intern​(java.lang.String original)  
      int size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringCache

        public StringCache()
      • StringCache

        public StringCache​(int lengthLimit)
    • Method Detail

      • cachedValueOf

        public java.lang.String cachedValueOf​(java.lang.String str)
      • size

        public int size()
      • intern

        public static java.lang.String intern​(java.lang.String original)