Back to project page Android-MultiPaneStream.
The source code is released under:
Apache License
If you think the Android project Android-MultiPaneStream 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 net.ichigotake.multipanestream.sdk; // w w w .jav a2s. com import android.support.v4.util.ArrayMap; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; public class ChannelJoiners { private final Map<String, List<Joiner>> joinersMap = new ArrayMap<String, List<Joiner>>(); public void add(Channel channel, Joiner joiner) { List<Joiner> joiners = joinersMap.get(channel.getName().toString()); if (joiners == null) { joiners = new CopyOnWriteArrayList<Joiner>(); } if (!joiners.contains(joiner)) { joiners.add(joiner); } joinersMap.put(channel.getName().toString(), joiners); } public List<Joiner> get(Channel channel) { List<Joiner> joiners = joinersMap.get(channel.getName().toString()); if (joiners == null) { joiners = new ArrayList<Joiner>(); } return joiners; } }