public class StringCache
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
accessCount
Access count.
|
protected static org.apache.tomcat.util.buf.StringCache.ByteEntry[] |
bcCache
Cache for byte chunk.
|
protected static int |
bcCount
toString count for byte chunk.
|
protected static java.util.HashMap<org.apache.tomcat.util.buf.StringCache.ByteEntry,int[]> |
bcStats
Statistics hash map for byte chunk.
|
protected static boolean |
byteEnabled
Enabled ?
|
protected static int |
cacheSize |
protected static org.apache.tomcat.util.buf.StringCache.CharEntry[] |
ccCache
Cache for char chunk.
|
protected static int |
ccCount
toString count for char chunk.
|
protected static java.util.HashMap<org.apache.tomcat.util.buf.StringCache.CharEntry,int[]> |
ccStats
Statistics hash map for char chunk.
|
protected static boolean |
charEnabled |
protected static int |
hitCount
Hit count.
|
protected static int |
maxStringSize |
protected static int |
trainThreshold |
| Constructor and Description |
|---|
StringCache() |
| Modifier and Type | Method and Description |
|---|---|
protected static int |
compare(ByteChunk name,
byte[] compareTo)
Compare given byte chunk with byte array.
|
protected static int |
compare(CharChunk name,
char[] compareTo)
Compare given char chunk with char array.
|
protected static java.lang.String |
find(ByteChunk name)
Deprecated.
Unused. Will be removed in Tomcat 11.
Use
find(ByteChunk, CodingErrorAction, CodingErrorAction) |
protected static java.lang.String |
find(ByteChunk name,
java.nio.charset.CodingErrorAction malformedInputAction,
java.nio.charset.CodingErrorAction unmappableCharacterAction)
Find an entry given its name in the cache and return the associated String.
|
protected static java.lang.String |
find(CharChunk name)
Find an entry given its name in the cache and return the associated String.
|
protected static int |
findClosest(ByteChunk name,
org.apache.tomcat.util.buf.StringCache.ByteEntry[] array,
int len)
Find an entry given its name in a sorted array of map elements.
|
protected static int |
findClosest(CharChunk name,
org.apache.tomcat.util.buf.StringCache.CharEntry[] array,
int len)
Find an entry given its name in a sorted array of map elements.
|
int |
getAccessCount() |
boolean |
getByteEnabled() |
int |
getCacheSize() |
boolean |
getCharEnabled() |
int |
getHitCount() |
int |
getTrainThreshold() |
void |
reset() |
void |
setByteEnabled(boolean byteEnabled) |
void |
setCacheSize(int cacheSize) |
void |
setCharEnabled(boolean charEnabled) |
void |
setTrainThreshold(int trainThreshold) |
static java.lang.String |
toString(ByteChunk bc) |
static java.lang.String |
toString(ByteChunk bc,
java.nio.charset.CodingErrorAction malformedInputAction,
java.nio.charset.CodingErrorAction unmappableCharacterAction) |
static java.lang.String |
toString(CharChunk cc) |
protected static boolean byteEnabled
protected static boolean charEnabled
protected static int trainThreshold
protected static int cacheSize
protected static final int maxStringSize
protected static final java.util.HashMap<org.apache.tomcat.util.buf.StringCache.ByteEntry,int[]> bcStats
protected static int bcCount
protected static volatile org.apache.tomcat.util.buf.StringCache.ByteEntry[] bcCache
protected static final java.util.HashMap<org.apache.tomcat.util.buf.StringCache.CharEntry,int[]> ccStats
protected static int ccCount
protected static volatile org.apache.tomcat.util.buf.StringCache.CharEntry[] ccCache
protected static int accessCount
protected static int hitCount
public int getCacheSize()
public void setCacheSize(int cacheSize)
cacheSize - The cacheSize to set.public boolean getByteEnabled()
public void setByteEnabled(boolean byteEnabled)
byteEnabled - The enabled to set.public boolean getCharEnabled()
public void setCharEnabled(boolean charEnabled)
charEnabled - The enabled to set.public int getTrainThreshold()
public void setTrainThreshold(int trainThreshold)
trainThreshold - The trainThreshold to set.public int getAccessCount()
public int getHitCount()
public void reset()
public static java.lang.String toString(ByteChunk bc)
public static java.lang.String toString(ByteChunk bc, java.nio.charset.CodingErrorAction malformedInputAction, java.nio.charset.CodingErrorAction unmappableCharacterAction) throws java.nio.charset.CharacterCodingException
java.nio.charset.CharacterCodingExceptionpublic static java.lang.String toString(CharChunk cc)
protected static final int compare(ByteChunk name, byte[] compareTo)
name - The name to comparecompareTo - The compared to data@Deprecated protected static final java.lang.String find(ByteChunk name)
find(ByteChunk, CodingErrorAction, CodingErrorAction)name - The name to findprotected static final java.lang.String find(ByteChunk name, java.nio.charset.CodingErrorAction malformedInputAction, java.nio.charset.CodingErrorAction unmappableCharacterAction)
name - The name to findmalformedInputAction - Action to take if an malformed input is encounteredunmappableCharacterAction - Action to take if an unmappable character is encounteredprotected static final int findClosest(ByteChunk name, org.apache.tomcat.util.buf.StringCache.ByteEntry[] array, int len)
name - The name to findarray - The array in which to looklen - The effective length of the arrayprotected static final int compare(CharChunk name, char[] compareTo)
name - The name to comparecompareTo - The compared to dataprotected static final java.lang.String find(CharChunk name)
name - The name to findprotected static final int findClosest(CharChunk name, org.apache.tomcat.util.buf.StringCache.CharEntry[] array, int len)
name - The name to findarray - The array in which to looklen - The effective length of the arrayCopyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.