Android Open Source - Android-MultiPaneStream Channel Tree






From Project

Back to project page Android-MultiPaneStream.

License

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.

Java Source Code

package net.ichigotake.multipanestream.sdk;
// w ww. j av a2s  .  co  m
import android.support.v4.util.ArrayMap;
import android.text.TextUtils;

import java.util.ArrayList;
import java.util.List;

public class ChannelTree {

    private final ArrayMap<ChannelCategory, List<Channel>> tree;

    public ChannelTree() {
        this.tree = new ArrayMap<ChannelCategory, List<Channel>>();
    }

    public void addChannel(ChannelCategory category, Channel channel) {
        List<Channel> channelList = getChannelList(category);
        if (!channelList.contains(channel)) {
            channelList.add(channel);
            this.tree.put(category, channelList);
        }
    }

    public List<Channel> getChannelList(ChannelCategory category) {
        List<Channel> channelList = this.tree.get(category);
        if (channelList == null) {
            channelList = new ArrayList<Channel>();
        }
        return channelList;
    }

    public ChannelCategory findCategory(String name) {
        ChannelCategory found = null;
        for (ChannelCategory item : tree.keySet()) {
            if (TextUtils.equals(name, item.getName())) {
                found = item;
            }
        }
        return found;
    }

    public boolean containsChannelCategory(ChannelCategory category) {
        return this.tree.get(category) != null;
    }
}




Java Source Code List

net.ichigotake.multipanestream.ApplicationTest.java
net.ichigotake.multipanestream.app.tablet.TabletMultiPaneStreamActivity.java
net.ichigotake.multipanestream.attribute.channel.ChannelAdapter.java
net.ichigotake.multipanestream.attribute.channel.ChannelTreeExpandableListCollection.java
net.ichigotake.multipanestream.attribute.channel.ChannelTreeFragment.java
net.ichigotake.multipanestream.attribute.channel.OnChannelSelectedListener.java
net.ichigotake.multipanestream.attribute.joiner.JoinerAdapter.java
net.ichigotake.multipanestream.attribute.joiner.JoinerFragment.java
net.ichigotake.multipanestream.sdk.ChannelBuilder.java
net.ichigotake.multipanestream.sdk.ChannelCategoryBuilder.java
net.ichigotake.multipanestream.sdk.ChannelCategoryImpl.java
net.ichigotake.multipanestream.sdk.ChannelCategory.java
net.ichigotake.multipanestream.sdk.ChannelImpl.java
net.ichigotake.multipanestream.sdk.ChannelJoiners.java
net.ichigotake.multipanestream.sdk.ChannelTree.java
net.ichigotake.multipanestream.sdk.Channel.java
net.ichigotake.multipanestream.sdk.JoinerBuilder.java
net.ichigotake.multipanestream.sdk.JoinerImpl.java
net.ichigotake.multipanestream.sdk.Joiner.java
net.ichigotake.multipanestream.sdk.MessageBuilder.java
net.ichigotake.multipanestream.sdk.MessageImpl.java
net.ichigotake.multipanestream.sdk.Message.java
net.ichigotake.multipanestream.stream.LogStreamFragment.java
net.ichigotake.multipanestream.stream.MainStreamFragment.java
net.ichigotake.multipanestream.stream.MessageView.java
net.ichigotake.multipanestream.stream.StreamAdapter.java
net.ichigotake.multipanestream.stream.StreamContainer.java