Back to project page you2peer.
The source code is released under:
Apache License
If you think the Android project you2peer 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.u2p.core.db; //from w ww . j a va2 s . c o m import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class DbGroups { private HashMap<String,List<DbFile>> groups; public DbGroups(){ groups=new HashMap<String,List<DbFile>>(); } public boolean addGroup(String group){ if(!groups.containsKey(group)){ groups.put(group,new ArrayList<DbFile>()); return true; } return false; } public boolean addFileToGroup(String group,DbFile file){ if(groups.containsKey(group)){ List<DbFile> files=groups.get(group); files.add(file); groups.put(group, files); return true; } return false; } public List<DbFile> getFilesGroup(String group){ if(groups.containsKey(group)){ return groups.get(group); } return null; } public boolean deleteFile(String group,DbFile file){ if(groups.containsKey(group)){ List<DbFile> files=groups.get(group); files.remove(file); return true; } return false; } }