org.eclipse.ecf.provider.rss.channel
Class RssItem

java.lang.Object
  extended by org.eclipse.ecf.provider.rss.channel.RssItem
All Implemented Interfaces:
java.io.Serializable

public class RssItem
extends java.lang.Object
implements java.io.Serializable

Represents an item in a RSS feed.

Author:
Sergey Yakovlev
See Also:
Serialized Form

Constructor Summary
RssItem(RssFeed feed, java.lang.String title, java.lang.String description, java.lang.String link)
          Constructs an item with the specified owner feed, title, link and description.
RssItem(java.lang.String title, java.lang.String description, java.lang.String link)
          Constructs an item with the specified title, link and description.
 
Method Summary
 void addExtension(org.w3c.dom.Element newElement)
          Adds a new extension element.
 int compareTo(RssItem anotherItem)
          Compares two items.
 RssItem delete()
          Deletes this item.
 boolean equals(java.lang.Object obj)
           
 java.util.List getConflicts()
          Gets the conflict list within this item.
 java.lang.String getDescription()
          Gets the item synopsis.
 java.util.List getExtensions()
          Gets the rss extensions.
 RssFeed getFeed()
          Gets the owner feed of the item.
 SseHistory getHistory()
          Gets the history element.
 java.net.URL getLink()
          Gets the URL of the item.
 java.util.Date getPubDate()
          Gets the Date indicates when the item was published.
 java.lang.String getSubject()
          Gets the subject of the item.
 SseSync getSync()
          Gets the sync element.
 java.lang.String getTitle()
          Gets the title of the item.
 java.lang.Integer getVersion()
          Gets the item version.
 RssItem processConflict(RssItem loserItem)
          Performs any necessary conflict processing.
 void setDescription(java.lang.String description)
          Sets the item synopsis.
 void setExtensions(java.util.List extensions)
          Sets the rss extensions.
 void setFeed(RssFeed feed)
          Sets the owner feed of the item.
 void setLink(java.lang.String link)
          Sets the URL of the item.
 void setLink(java.net.URL link)
          Sets the URL of the item.
 void setPubDate(java.util.Date pubDate)
          Sets the Date indicates when the item was published.
 void setPubDate(java.lang.String pubDate)
          Sets the Date indicates when the item was published.
 void setSubject(java.lang.String subject)
          Sets the subject of the item.
 void setSync(SseSync sync)
          Sets the sync element.
 void setTitle(java.lang.String title)
          Sets the title of the item.
 RssItem update(RssItem newItem)
          Updates this item with the specified one.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RssItem

public RssItem(java.lang.String title,
               java.lang.String description,
               java.lang.String link)
Constructs an item with the specified title, link and description.

Parameters:
title - - the title to use
description - - the description
link - - the link

RssItem

public RssItem(RssFeed feed,
               java.lang.String title,
               java.lang.String description,
               java.lang.String link)
Constructs an item with the specified owner feed, title, link and description.

Parameters:
feed - - the owner feed object
title - - the title to use
description - - the description
link - - the link
Method Detail

getDescription

public java.lang.String getDescription()
Gets the item synopsis.

Returns:
a description as a string

getLink

public java.net.URL getLink()
Gets the URL of the item.

Returns:
a link as a URL

getTitle

public java.lang.String getTitle()
Gets the title of the item.

Returns:
a title as a string

getFeed

public RssFeed getFeed()
Gets the owner feed of the item.

Returns:
owner feed or null if none in use.

getSubject

public java.lang.String getSubject()
Gets the subject of the item.

Returns:
a subject as a string.

getPubDate

public java.util.Date getPubDate()
Gets the Date indicates when the item was published.

Returns:
a pubDate as a Date.

getSync

public SseSync getSync()
Gets the sync element.

Returns:
SseSync object.

setDescription

public void setDescription(java.lang.String description)
Sets the item synopsis.

Parameters:
description - - the String containing the description representation.

setTitle

public void setTitle(java.lang.String title)
Sets the title of the item.

Parameters:
title - - the String containing the title representation.

setLink

public void setLink(java.net.URL link)
Sets the URL of the item.

Parameters:
link - - the URL object containing the link.

setLink

public void setLink(java.lang.String link)
Sets the URL of the item.

Parameters:
link - - the String containing the link representation.

setFeed

public void setFeed(RssFeed feed)
Sets the owner feed of the item.

Parameters:
feed - - the RssFeed object.

setSubject

public void setSubject(java.lang.String subject)
Sets the subject of the item.

Parameters:
subject - - the String containing the subject representation.

setPubDate

public void setPubDate(java.util.Date pubDate)
Sets the Date indicates when the item was published.

Parameters:
pubDate - - the Date.

setPubDate

public void setPubDate(java.lang.String pubDate)
Sets the Date indicates when the item was published.

Parameters:
pubDate - - the String containing the publish Date representation.

setSync

public void setSync(SseSync sync)
Sets the sync element.

Parameters:
sync - - the SseSync object.

compareTo

public int compareTo(RssItem anotherItem)
Compares two items.

Parameters:
anotherItem - - the RssItem to be compared.
Returns:
the value 0 if the argument item is equal to this item; a value less than 0 if this item is later than the item argument; and a value greater than 0 if this item is newer than the item argument.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

processConflict

public RssItem processConflict(RssItem loserItem)
Performs any necessary conflict processing.

Parameters:
loserItem - - the RssItem to be compared.
Returns:
a reference to this object.

update

public RssItem update(RssItem newItem)
Updates this item with the specified one.

Parameters:
newItem - - the RssItem for update.
Returns:
- a reference to this object.

delete

public RssItem delete()
Deletes this item.

Returns:
- a reference to this object.

getVersion

public java.lang.Integer getVersion()
Gets the item version.

Returns:
- the Integer containing the item version.

getHistory

public SseHistory getHistory()
Gets the history element.

Returns:
- the SseHistory object.

getConflicts

public java.util.List getConflicts()
Gets the conflict list within this item.

Returns:
a conflict list.

addExtension

public void addExtension(org.w3c.dom.Element newElement)
Adds a new extension element.

Parameters:
newElement - The element to add.

getExtensions

public java.util.List getExtensions()
Gets the rss extensions.

Returns:
Returns the rss extensions.

setExtensions

public void setExtensions(java.util.List extensions)
Sets the rss extensions.

Parameters:
extensions - The rss extensions to set.