@Public
@Stable
public class StringInterner
extends java.lang.Object
| Constructor | Description |
|---|---|
StringInterner() |
| Modifier and Type | Method | Description |
|---|---|---|
static java.lang.String[] |
internStringsInArray(java.lang.String[] strings) |
Interns all the strings in the given array in place,
returning the same array.
|
static java.lang.String |
strongIntern(java.lang.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 java.lang.String |
weakIntern(java.lang.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 java.lang.String strongIntern(java.lang.String sample)
sample - string instance to be internedpublic static java.lang.String weakIntern(java.lang.String sample)
sample - string instance to be internedpublic static java.lang.String[] internStringsInArray(java.lang.String[] strings)
strings - strings.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.