-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
* Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.utils.Log_OC;
-import com.owncloud.android.operations.UploadFileOperation;
import java.io.File;
-import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
* A map provides the indexation based in hashing.
*
* A tree is created per account.
- *
- * @author David A. Velasco
*/
public class IndexedForest<V> {
}
- public ConcurrentMap<String, Node<V>> get(Account account){
- ConcurrentMap<String, Node<V>> accountMap = new ConcurrentHashMap<String, Node<V>>();
+ /**
+ * Remove the elements that contains account as a part of its key
+ * @param account
+ */
+ public void remove(Account account){
Iterator<String> it = mMap.keySet().iterator();
while (it.hasNext()) {
String key = it.next();
Log_OC.d("IndexedForest", "Number of pending downloads= " + mMap.size());
if (key.startsWith(account.name)) {
- synchronized (accountMap) {
- accountMap.putIfAbsent(key, mMap.get(key));
- }
+ mMap.remove(key);
}
}
- return accountMap;
}
/**
return account.name + remotePath;
}
-
-
}