Code example for TreeMap

Methods: getput

public class TypeFaceHelper { 
    private static TreeMap<String, Typeface> mTypefaceCache = new TreeMap<String, Typeface>();  
    public static Typeface createFromAsset(Context context, String path) {
        Typeface tf = mTypefaceCache.get(path);
        if (tf != null)
            return tf;
        AssetManager am = context.getAssets();
        if (am == null)
            return null; 
        try { 
            tf = Typeface.createFromAsset(am, path);
            mTypefaceCache.put(path, tf);
        } catch (RuntimeException e) {
            mTypefaceCache.put(path, null);
        return tf;
Connect your IDE to all the code out there  Get Codota for Java