Class ChannelList

    • Constructor Detail

      • ChannelList

        public ChannelList()

        Creates a new instance.

      • ChannelList

        public ChannelList​(java.util.Collection<Channel> coll)
    • Method Detail

      • getChannels

        public java.util.List<Channel> getChannels()

        Returns the underlying List of Channels.

        Returns:
        the underlying List of Channels
      • setChannels

        public void setChannels​(java.util.List<Channel> l)

        Set the underlying List of Channels.

        Parameters:
        l - the underlying List of Channels
      • addChannel

        public void addChannel​(Channel channel)

        Adds a Channel to the underlying List and validates its unique ID.

        Parameters:
        channel - the Channel to add
      • getChannel

        public Channel getChannel​(int pos)

        Returns the Channel stored at the passed pos in the List.

        Parameters:
        pos - the position in the List
        Returns:
        the Channel stored at the passed pos in the List
      • size

        public int size()

        Returns the number of Channel s in this ChannelList.

        Specified by:
        size in interface java.util.Collection<Channel>
        Specified by:
        size in interface java.util.List<Channel>
        Specified by:
        size in class java.util.AbstractCollection<Channel>
        Returns:
        the number of Channel s in this ChannelList
      • getChannel

        public Channel getChannel​(java.lang.String uniqueId)

        Returns the Channel with the passed uniqueId or null if no such channel exists.

        Parameters:
        uniqueId - the unique ID of the Channel to return, may not be null or empty
        Returns:
        the requested Channel or null if it doesn't exist, will always be null unless prepare() has been called.
      • iterator

        public java.util.Iterator<Channel> iterator()
        Specified by:
        iterator in interface java.util.Collection<Channel>
        Specified by:
        iterator in interface java.lang.Iterable<Channel>
        Specified by:
        iterator in interface java.util.List<Channel>
        Specified by:
        iterator in class java.util.AbstractCollection<Channel>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<Channel>
        Specified by:
        remove in interface java.util.List<Channel>
        Overrides:
        remove in class java.util.AbstractCollection<Channel>
      • removeChannel

        public boolean removeChannel​(Channel channel)
        Remove a channel from this channel list.
        Parameters:
        channel -
        Returns:
        true if the channel was removed successfully.
      • add

        public boolean add​(Channel element)
        Specified by:
        add in interface java.util.Collection<Channel>
        Specified by:
        add in interface java.util.List<Channel>
        Overrides:
        add in class java.util.AbstractCollection<Channel>
      • add

        public void add​(int index,
                        Channel element)
        Specified by:
        add in interface java.util.List<Channel>
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends Channel> c)
        Specified by:
        addAll in interface java.util.List<Channel>
      • get

        public Channel get​(int index)
        Specified by:
        get in interface java.util.List<Channel>
      • indexOf

        public int indexOf​(java.lang.Object o)
        Specified by:
        indexOf in interface java.util.List<Channel>
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o)
        Specified by:
        lastIndexOf in interface java.util.List<Channel>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<Channel>
        Specified by:
        clear in interface java.util.List<Channel>
        Overrides:
        clear in class java.util.AbstractCollection<Channel>
      • listIterator

        public java.util.ListIterator<Channel> listIterator()
        Specified by:
        listIterator in interface java.util.List<Channel>
      • listIterator

        public java.util.ListIterator<Channel> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<Channel>
      • remove

        public Channel remove​(int index)
        Specified by:
        remove in interface java.util.List<Channel>
      • set

        public Channel set​(int index,
                           Channel element)
        Specified by:
        set in interface java.util.List<Channel>
      • subList

        public java.util.List<Channel> subList​(int fromIndex,
                                               int toIndex)
        Specified by:
        subList in interface java.util.List<Channel>