Code example for Hashtable

0
import android.content.res.AssetManager; 
import android.graphics.Typeface; 
 
public class Typefaces { 
 
	private static final Hashtable<String, Typeface> cache = new Hashtable<String, Typeface>();
 
	public static Typeface get(AssetManager assets, String name) {
		synchronized (cache) {
			if (!cache.containsKey(name)) {
				Typeface t = Typeface.createFromAsset(assets, name);
				cache.put(name, t);
			} 
			return cache.get(name);
		} 
	} 
 
}