public class StringEncoderCache extends AbstractStringCache
This class is thread safe. Thread safety is achieved by maintaining two data
structures. The first is a map of seen strings to the number of times the
string has been seen. The map is maintained by the base class:
AbstractStringCache. The second structure is a simple map of the
String to the encoded
byte. The map has no locking
or synchronization since it is read-only after construction.
|Constructor and Description|
Creates a new StringEncoder.
|Modifier and Type||Method and Description|
Clears the cache.
Looks in the cache for encoded bytes for the specified string.
Rebuilds the cache from the current collection of seen entries.
buildCacheGroups, getMaxCacheEntries, getMaxCacheLength, setMaxCacheEntries, setMaxCacheLength, used
public byte find(String string)
string- The string value to find the cached bytes for.
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.