Search in sources :

Example 66 with WeakHashMap

use of java.util.WeakHashMap in project Slide by ccrama.

the class SubmissionCache method cacheInfo.

private static void cacheInfo(List<Submission> submissions, Context mContext, String baseSub) {
    if (titles == null)
        titles = new WeakHashMap<>();
    if (info == null)
        info = new WeakHashMap<>();
    if (crosspost == null)
        crosspost = new WeakHashMap<>();
    for (Submission submission : submissions) {
        titles.put(submission.getFullName(), getTitleSpannable(submission, mContext));
        info.put(submission.getFullName(), getInfoSpannable(submission, mContext, baseSub));
        crosspost.put(submission.getFullName(), getCrosspostLine(submission, mContext));
    }
}
Also used : Submission(net.dean.jraw.models.Submission) WeakHashMap(java.util.WeakHashMap)

Aggregations

WeakHashMap (java.util.WeakHashMap)66 Map (java.util.Map)20 HashMap (java.util.HashMap)19 TreeMap (java.util.TreeMap)15 IdentityHashMap (java.util.IdentityHashMap)13 AbstractMap (java.util.AbstractMap)12 LinkedHashMap (java.util.LinkedHashMap)12 ICC_ColorSpace (java.awt.color.ICC_ColorSpace)8 ColorTransform (sun.java2d.cmm.ColorTransform)8 PCMM (sun.java2d.cmm.PCMM)8 Hashtable (java.util.Hashtable)6 AttributedString (java.text.AttributedString)5 ArrayList (java.util.ArrayList)5 Properties (java.util.Properties)5 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)5 Comparator (java.util.Comparator)4 List (java.util.List)4 TreeSet (java.util.TreeSet)4 WeakReference (java.lang.ref.WeakReference)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)3