rss.adt
Class FeedItem

java.lang.Object
  extended by rss.adt.FeedItem
All Implemented Interfaces:
java.io.Serializable

public final class FeedItem
extends java.lang.Object
implements java.io.Serializable

Abstract data type corresponding with the individual feed item.

Abstraction Function:



Representation Invariant: id must be a unique, positive identifier over all FeedItems title, author, updatedDate, publishedDate, content, link, enclosure must not be null

Author:
Jong-Moon Kim, Karl Rieb, Lydia Chilton
See Also:
Serialized Form

Constructor Summary
FeedItem(int id, java.lang.String title, java.util.List<java.lang.String> author, java.util.Date updatedDate, java.util.Date publishedDate, java.lang.String content, java.lang.String link, java.util.List<java.lang.String> enclosure)
          Initializes the feed item with the given parameters.
 
Method Summary
 boolean equals(java.lang.Object o)
          Two FeedItems are only equal when the Title, Author, Content, Link, PublishedDate, and Enclosure are identical.
 java.util.List<java.lang.String> getAuthor()
          Accessor for the author(s) that wrote the FeedItem
 java.lang.String getContent()
          Accessor for the content of the FeedItem.
 java.util.List<java.lang.String> getEnclosure()
          Accessor for the enclosure(s) of the FeedItem.
 int getId()
          Accessor for the unique identifier of the FeedItem
 java.lang.String getLink()
          Accessor for the included link
 java.util.Date getPublishedDate()
          Accessor for the published date of the feedItem
 java.lang.String getTitle()
          Accessor for the title of the FeedItem
 java.util.Date getUpdatedDate()
          Accessor for the updated date the feedItem has been downloaded
 int hashCode()
          Encoding for generating unique hashCodes for different feedItems
 boolean isRead()
          Accessor to check if a feedItem has been read.
 void setRead(boolean read)
          Modifier to set whether a feedItem has been read.
 java.lang.String toString()
          Outputs contents of internal fields meant to be used as debug method
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeedItem

public FeedItem(int id,
                java.lang.String title,
                java.util.List<java.lang.String> author,
                java.util.Date updatedDate,
                java.util.Date publishedDate,
                java.lang.String content,
                java.lang.String link,
                java.util.List<java.lang.String> enclosure)
Initializes the feed item with the given parameters.

Parameters:
id - Unique identifier
title - Title of feed item
author - Author
updatedDate - Retrieved date from web
publishedDate - Original published date on the web
content - Content text
link - Link included
enclosure - Enclosures
Method Detail

isRead

public boolean isRead()
Accessor to check if a feedItem has been read.

Returns:
True if read, false if not.

setRead

public void setRead(boolean read)
Modifier to set whether a feedItem has been read.

Parameters:
read -

getAuthor

public java.util.List<java.lang.String> getAuthor()
Accessor for the author(s) that wrote the FeedItem

Returns:
list of authors of the FeedItem

getContent

public java.lang.String getContent()
Accessor for the content of the FeedItem.

Returns:
text content

getEnclosure

public java.util.List<java.lang.String> getEnclosure()
Accessor for the enclosure(s) of the FeedItem.

Returns:
list of enclosures

getId

public int getId()
Accessor for the unique identifier of the FeedItem

Returns:
unique identifier of the FeedItem

getLink

public java.lang.String getLink()
Accessor for the included link

Returns:
included link

getPublishedDate

public java.util.Date getPublishedDate()
Accessor for the published date of the feedItem

Returns:
published date

getTitle

public java.lang.String getTitle()
Accessor for the title of the FeedItem

Returns:
title

getUpdatedDate

public java.util.Date getUpdatedDate()
Accessor for the updated date the feedItem has been downloaded

Returns:
updated date

toString

public java.lang.String toString()
Outputs contents of internal fields meant to be used as debug method

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Encoding for generating unique hashCodes for different feedItems

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Two FeedItems are only equal when the Title, Author, Content, Link, PublishedDate, and Enclosure are identical.

Overrides:
equals in class java.lang.Object