Class StringInterner

  • Direct Known Subclasses:
    SimpleStringInterner

    public class StringInterner
    extends Object
    Subclasses of StringInterner are required to return the same single String object for all equal strings. Depending on the implementation, this may not be the same object returned as String.intern(). This StringInterner base class simply delegates to String.intern().
    • Constructor Detail

      • StringInterner

        public StringInterner()
    • Method Detail

      • intern

        public String intern​(String s)
        Returns a single object instance for each equal string.
      • intern

        public String intern​(char[] arr,
                             int offset,
                             int len)
        Returns a single object instance for each equal string.