Code example for ConcurrentHashMap

Methods: containsKey

0
 
		return true; 
	} 
 
	public static boolean isExecuting(String key) {
		return mResults.containsKey(key) || mTasks.containsKey(key);
	} 
 
	public static void addListener(String key, TaskListener listener) {
		if (mResults.containsKey(key)) {
			Object results = getResultValue(mResults.remove(key));
 
			if (listener != null) {
				listener.onTaskCompleted(results);
			} 
 
			return; 
		} 
 
		if (mTasks.containsKey(key)) {
			mTasks.get(key).addListener(listener);