public class SimpleStringInterner extends StringInterner
Constructor | Description |
---|---|
SimpleStringInterner(int tableSize,
int maxChainLength) |
Modifier and Type | Method | Description |
---|---|---|
String |
intern(String s) |
Returns a single object instance for each equal string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
intern
public 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)
StringInterner
intern
in class StringInterner
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.