com.sonettic.mrss.elements
Class MRSSChannel

java.lang.Object
  extended by com.sonettic.mrss.elements.MRSSChannel

public class MRSSChannel
extends java.lang.Object

Class that represent channel node of the Sonettic playlist MRRS. Carries out a role of the container for all other data.

Author:
Vasyl Skrypij

Constructor Summary
MRSSChannel(java.util.List<MRSSItem> items, java.lang.String id)
          Public constructor
MRSSChannel(java.lang.String id)
          Public constructor
 
Method Summary
 void addItem(MRSSItem item)
          Append item to current channel.
 void addItems(java.util.Collection<MRSSItem> items)
          Appends all of the items in the collection to this channel.
 void addNode(MRSSNode node)
          Adding any optional node which is not represented by class to current channel.
 org.dom4j.Element build(org.dom4j.Element element)
          Build channel in org.dom4j.Element with all child nodes.
 MRSSAds getAds()
          Getter for ads node of this channel.
 java.lang.String getId()
          Id getter.
 java.util.List<MRSSItem> getItems()
          Getter for items of this channel
 java.util.List<MRSSNode> getNodes()
          Get MRSSNodes of this channel.
 MRSSPoster getPoster()
          Getter for poster node of this channel.
 void setAds(MRSSAds ads)
          Setter for ads node of this channel.
 void setId(java.lang.String id)
          Id setter.
 void setPoster(MRSSPoster poster)
          Setter for poster node of this channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MRSSChannel

public MRSSChannel(java.lang.String id)
Public constructor

Parameters:
id - unique id of current channel

MRSSChannel

public MRSSChannel(java.util.List<MRSSItem> items,
                   java.lang.String id)
Public constructor

Parameters:
items - list of MRSSItem objects for current channel.
id - id of current channel.
Method Detail

getId

public java.lang.String getId()
Id getter.

Returns:
id of current channel.

setId

public void setId(java.lang.String id)
Id setter.

Parameters:
id - of current channel.

getAds

public MRSSAds getAds()
Getter for ads node of this channel.

Returns:
ads, or null, if channel has not ads.

setAds

public void setAds(MRSSAds ads)
Setter for ads node of this channel.

Parameters:
ads - MRSSAds object.

getPoster

public MRSSPoster getPoster()
Getter for poster node of this channel.

Returns:
poster, or null, if channel has not poster.

setPoster

public void setPoster(MRSSPoster poster)
Setter for poster node of this channel.

Parameters:
poster - MRSSPoster object.

getItems

public java.util.List<MRSSItem> getItems()
Getter for items of this channel

Returns:
items.

addItems

public void addItems(java.util.Collection<MRSSItem> items)
Appends all of the items in the collection to this channel.

Parameters:
items - collection of items.

addItem

public void addItem(MRSSItem item)
Append item to current channel.

Parameters:
item - item

getNodes

public java.util.List<MRSSNode> getNodes()
Get MRSSNodes of this channel.

Returns:
list of nodes.

addNode

public void addNode(MRSSNode node)
Adding any optional node which is not represented by class to current channel.

Parameters:
node -

build

public org.dom4j.Element build(org.dom4j.Element element)
Build channel in org.dom4j.Element with all child nodes.

Parameters:
element - element to which should be added the channel
Returns:
element with added channel.