Code example for ConcurrentHashMap

Methods: containsKey, get, put

0
		} 
		return instance;
	} 
	 
	public boolean containsURL(URL url) {
		return cache.containsKey(url);
	} 
	 
	public Bitmap get(URL url) {
		return cache.get(url);
	} 
		 
	public Bitmap load(URL url) throws IOException {
		if (containsURL(url)) { return get(url); }
		Bitmap bitmap = BitmapFactory.decodeStream(url.openStream());
		cache.put(url, bitmap);
		return bitmap;
	} 
}