|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.umlv.tatoo.runtime.util.StringCache
public final class StringCache
Utility class which caches strings obtained from byte buffer.
| Constructor Summary | |
|---|---|
StringCache(String charsetName,
int size,
int len,
int maxSize)
Constructor of an empty string cache. |
|
| Method Summary | |
|---|---|
String |
add(ByteBuffer bb)
Add a new string in the cache. |
String |
add(CharSequence cb)
Add a new string in the cache. |
String |
addLowerCase(ByteBuffer bb)
Add a new string in the cache. |
String |
addLowerCase(CharBuffer cb)
Add a new string in the cache. |
void |
clear()
Remove all strings from the cache. |
static boolean |
equals(CharSequence cs1,
CharSequence cs2)
Compare the content of a ByteBuffer between position and limit with the content of a string. |
int |
getMaxStringLength()
Maximum length of the strings in the cache. |
int |
getStringNumber()
The number of strings in the cache. |
static int |
hashcode(CharSequence s)
Compute hashcode of a char sequence. |
void |
load(BufferedReader reader)
Reads the content of the cache from the reader provided as argument. |
void |
remove(String s)
Remove a string from the cache. |
void |
store(PrintWriter out)
Writes all strings contained in the cache on the writer provided as argument. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringCache(String charsetName,
int size,
int len,
int maxSize)
charsetName - the name of charset used in ByteBuffers.size - initial size of the initial cache.len - the maximun string length in the cache.maxSize - the maximum size of the cache.| Method Detail |
|---|
public int getMaxStringLength()
public int getStringNumber()
public void clear()
public void remove(String s)
s - the string to remove from the cache.public String add(ByteBuffer bb)
bb - contains the String to cache between position and limit.
public String add(CharSequence cb)
cb - contains the String to cache between position and limit.
public String addLowerCase(ByteBuffer bb)
bb - a ByteBuffer value
String valuepublic String addLowerCase(CharBuffer cb)
cb - a ByteBuffer value
String value
public static boolean equals(CharSequence cs1,
CharSequence cs2)
cs1 - the first string to compare.cs2 - the second string to compare.
public static int hashcode(CharSequence s)
s - char sequence which hashcode is to compute.
public void store(PrintWriter out)
out - output writer where content must be written.
public void load(BufferedReader reader)
throws IOException
reader - the reader where strings are read.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||