public class FastStringPool extends Object
FastString
Constructor and Description |
---|
FastStringPool() |
FastStringPool(int initialPoolSize,
int maxPoolStringLength,
boolean phongHash) |
Modifier and Type | Method and Description |
---|---|
void |
enlargePool() |
int |
getFirstEntryCount() |
int |
getPoolSize() |
int |
getSecondEntryCount() |
protected int |
hash(String str) |
String |
lookup(char[] chars,
int start,
int end)
Returns a string that of equivalent contents to the original string.
|
String |
lookup(String string)
Returns a string that of equivalent contents to the original string.
|
String |
lookup(StringBuilder string,
int start,
int end)
Returns a string that of equivalent contents to the original string.
|
protected boolean |
match(String str,
char[] chars) |
protected boolean |
match(String str,
char[] chars,
int start,
int end) |
protected static int |
primeFromField(int field)
Returns the largest prime number in this field.
|
public FastStringPool()
public FastStringPool(int initialPoolSize, int maxPoolStringLength, boolean phongHash)
public int getPoolSize()
public int getFirstEntryCount()
public int getSecondEntryCount()
public void enlargePool()
protected int hash(String str)
public String lookup(String string)
If the original string is null or empty, the canonical empty string will be returned. If the original string is longer than a specified length, it will not be used in the pool as its non-uniqurness is not guaranteed.
string
- The original stringpublic String lookup(StringBuilder string, int start, int end)
If the original string is null or empty, the canonical empty string will be returned. If the original string is longer than a specified length, it will not be used in the pool as its non-uniqurness is not guaranteed.
string
- The original stringpublic String lookup(char[] chars, int start, int end)
If the original string is null or empty, the canonical empty string will be returned. If the original string is longer than a specified length, it will not be used in the pool as its non-uniqueness is not guaranteed.
protected boolean match(String str, char[] chars, int start, int end)
protected boolean match(String str, char[] chars)
protected static int primeFromField(int field)
field
- The field sizePhantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.