public class SimpleStringInterner extends StringInterner
| Constructor and Description |
|---|
SimpleStringInterner(int tableSize,
int maxChainLength) |
| Modifier and Type | Method and Description |
|---|---|
String |
intern(String s)
Returns a single object instance for each equal string.
|
internpublic SimpleStringInterner(int tableSize,
int maxChainLength)
tableSize - Size of the hash table, should be a power of two.maxChainLength - Maximum length of each bucket, after which the oldest item inserted is dropped.public String intern(String s)
StringInternerintern in class StringInterner