org.jikesrvm.classloader
Class Atom.InternedStrings

java.lang.Object
  extended by org.jikesrvm.classloader.Atom.InternedStrings
Enclosing class:
Atom

private static class Atom.InternedStrings
extends Object

Inner class responsible for string interning. This class' initializer is run during booting.


Field Summary
private static WeakHashMap<String,WeakReference<String>> internedStrings
          Look up for interned strings.
 
Constructor Summary
private Atom.InternedStrings()
           
 
Method Summary
(package private) static String findAtomString(String str)
          Find a string literal from an atom
(package private) static String findInternedString(String str)
          Find an interned string but don't create it if not found
(package private) static String internUnfoundString(String str)
          Intern a string that is not an atom or already interned string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

internedStrings

private static final WeakHashMap<String,WeakReference<String>> internedStrings
Look up for interned strings.

Constructor Detail

Atom.InternedStrings

private Atom.InternedStrings()
Method Detail

findInternedString

static String findInternedString(String str)
Find an interned string but don't create it if not found

Parameters:
str - string to lookup
Returns:
the interned string or null if it isn't interned

findAtomString

static String findAtomString(String str)
Find a string literal from an atom

Parameters:
str - string to find
Returns:
the string literal or null

internUnfoundString

static String internUnfoundString(String str)
Intern a string that is not an atom or already interned string

Parameters:
str - string to intern
Returns:
interned string