Package opennlp.tools.util.jvm
Class CHMStringInterner
java.lang.Object
opennlp.tools.util.jvm.CHMStringInterner
- All Implemented Interfaces:
StringInterner
A
StringInterner implementation based on ConcurrentHashMap by Aleksey Shipilëv.
Origin: https://shipilev.net/jvm/anatomy-quarks/10-string-intern/
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CHMStringInterner
public CHMStringInterner()
-
-
Method Details
-
intern
Interns and returns a reference to the representative instance for any collection of string instances that are equal to each other.- Specified by:
internin interfaceStringInterner- Parameters:
sample- string instance to be interned- Returns:
- reference to the interned string instance
-