|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elib.util.ClassCache
Untamed: A performance optimizing hack: by hanging onto classes that are looked up by name, we can spare Java's overhead if they ever have to be looked up again.
Also recognizes the names for the scalar types and "void".
XXX The original motivation -- the surprising overhead of Java's
Class.forName(String)
may have been long fixed, in which case this
implementation should do less.
Field Summary | |
private static Hashtable |
OurCache
Using java.util.Hashtables instead of ELib's tables in order to avoid circular dependencies, and in order to get the thread-safety necessary for static used globally shared across a JVM. |
Constructor Summary | |
private |
ClassCache()
prevent instantiation |
Method Summary | |
static Class |
forName(String name)
Enabled: Like Class.forName(String) , but also accepts the string-names
for the scalar types and "void". |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final Hashtable OurCache
Constructor Detail |
private ClassCache()
Method Detail |
public static Class forName(String name) throws ClassNotFoundException
Class.forName(String)
, but also accepts the string-names
for the scalar types and "void".
ClassNotFoundException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |