Back to project page StreamHub-Android-Reviews-App.
The source code is released under:
MIT License
If you think the Android project StreamHub-Android-Reviews-App listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.filepicker.sdk; //ww w . j a v a 2 s . c o m import java.util.HashMap; public class DataCache { private static DataCache datacache; private HashMap<String, CacheElement> cache; private DataCache() { this.cache = new HashMap<String, CacheElement>(); } public static DataCache getInstance() { synchronized (DataCache.class) { if (datacache == null) return datacache = new DataCache(); else return datacache; } } public void clearCache() { cache.clear(); } public void put(String url, Folder data) { cache.put(url, new CacheElement(data)); } public Folder get(String url) { CacheElement c = cache.get(url); if (c == null) { return null; } else { return c.getData(); } } }