@InterfaceAudience.Public @InterfaceStability.Stable public class StringInterner extends Object
Constructor and Description |
---|
StringInterner() |
Modifier and Type | Method and Description |
---|---|
static String[] |
internStringsInArray(String[] strings)
Interns all the strings in the given array in place,
returning the same array.
|
static String |
strongIntern(String sample)
Interns and returns a reference to the representative instance
for any of a collection of string instances that are equal to each other.
|
static String |
weakIntern(String sample)
Interns and returns a reference to the representative instance
for any of a collection of string instances that are equal to each other.
|
public static String strongIntern(String sample)
sample
- string instance to be internedpublic static String weakIntern(String sample)
sample
- string instance to be internedCopyright © 2022 Apache Software Foundation. All rights reserved.