|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlazyj.StringFactory
public final class StringFactory
Keep references to common strings to avoid filling the memory with garbage. We don't use String.intern() any more because it seems to never clean up. Instead it is now relaying on a WeakHashMap.
String.intern()| Constructor Summary | |
|---|---|
StringFactory()
|
|
| Method Summary | |
|---|---|
static void |
clear()
Deprecated. |
static java.lang.String |
get(byte[] vb)
Get the global string pointer for this byte array |
static java.lang.String |
get(char[] vc)
Get the global string pointer for this char array |
static java.lang.String |
get(java.lang.String s)
Get the global string pointer for this value |
static long |
getAccessCount()
Get the total number of accesses to this cache |
static int |
getCacheSize()
Statistics function: the number of strings in the cache. |
static double |
getHitRatio()
Calculate the cache efficiency (hits / total requests) |
static double |
getIgnoreRatio()
Calculate the percentage of requests that were ignored because of size limits. |
static void |
resetHitCounters()
Clear the counters |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringFactory()
| Method Detail |
|---|
public static java.lang.String get(byte[] vb)
vb -
public static java.lang.String get(char[] vc)
vc -
public static java.lang.String get(java.lang.String s)
s -
public static int getCacheSize()
public static double getHitRatio()
public static double getIgnoreRatio()
public static long getAccessCount()
public static void resetHitCounters()
@Deprecated public static void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||