|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.java.feednread.backend.model.newstable.NewsFeed
Wrapper class for Rome SyndFeed newsfeed representation that
adds support for wrapping and unwrapping SyndEntry news
representations to/from NewsFeedEntry instances.
| Field Summary | |
protected List |
newsFeedEntries
The List of NewsFeedEntry wrapper objects
|
protected SyndFeed |
originalFeed
The original Rome SyndFeed representation |
static long |
serialVersionUID
The serialVersionUID of this class |
protected String |
url
The url of the NewsFeed |
| Constructor Summary | |
NewsFeed()
Creates a new empty NewsFeed.
|
|
NewsFeed(String url,
SyndFeed originalFeed)
Creates a new NewsFeed for the newsfeed at the specified
url wrapping up the specified Rome SyndFeed
representation.
|
|
| Method Summary | |
void |
addToArchive(NewsFeedArchive archive)
Adds this NewsFeed to the specified
NewsFeedArchive. |
int |
compareTo(Object obj)
Compares this NewsFeed to another NewsFeed
object based on the published date as returned by the
getPublishedDate() method.
|
boolean |
equals(Object obj)
Tests if this NewsFeed is equal to the specified
obj. |
List |
getAuthors()
Gets the feed authors. |
String |
getCopyright()
Gets the feed copyright. |
String |
getDescription()
Gets the feed description. |
String |
getEncoding()
Gets the charset encoding of a the feed. |
List |
getEntries()
Gets the feed entries. |
String |
getFeedType()
Returns the type of this NewsFeed
Currently the following syndication types are supported:
rss_0.90
rss_0.91
rss_0.92
rss_0.93
rss_0.94
rss_1.0
rss_2.0
atom_0.3
|
SyndImage |
getImage()
Gets the feed image. |
String |
getLanguage()
Gets the feed language. |
String |
getLink()
Gets the feed link. |
List |
getOriginalEntries()
Gets the original Rome SyndEntry entries.
|
SyndFeed |
getOriginalFeed()
Gets the original Rome SyndFeed representation that this
NewsFeed wraps up.
|
Date |
getPublishedDate()
Gets the feed published date. |
int |
getReadCount()
Gets the number of read news in this NewsFeed.
|
NewsFeedEntry[] |
getReadNews()
Gets all read news of this NewsFeed.
|
String |
getTitle()
Gets the feed title. |
int |
getUnreadCount()
Gets the number of unread news in this NewsFeed.
|
NewsFeedEntry[] |
getUnreadNews()
Gets all unread news of this NewsFeed.
|
String |
getUrl()
Gets the url of this NewsFeed
|
int |
hashCode()
Calculates the hashcode of this NewsFeed.
|
private void |
initializeEntries()
Initializes the news embedded in the wrapped SyndFeed
by creating a NewsFeedEntry wrapper object for each single
Rome SyndEntrynews entry.
|
boolean |
isUnread()
Returns true if this NewsFeed is unread.
|
void |
markAllRead()
Marks all news as read. |
void |
markAllUnread()
Marks all news as unread. |
void |
setAuthors(List authors)
Sets the feed authors. |
void |
setCopyright(String copyright)
Sets the feed copyright. |
void |
setDescription(String description)
Sets the feed description. |
void |
setEncoding(String encoding)
Sets the charset encoding of a the feed. |
void |
setEntries(List entries)
Sets the feed entries. |
void |
setFeedType(String feedType)
Sets the feed type of this NewsFeed
Currently the following syndication types are supported:
rss_0.90
rss_0.91
rss_0.92
rss_0.93
rss_0.94
rss_1.0
rss_2.0
atom_0.3
|
void |
setImage(SyndImage image)
Sets the feed image. |
void |
setLanguage(String language)
Sets the feed language. |
void |
setLink(String link)
Sets the feed link. |
void |
setOriginalEntries(List entries)
Sets the original Rome SyndEntry entries.
|
void |
setPublishedDate(Date publishedDate)
Sets the feed published date. |
void |
setTitle(String title)
Sets the feed title. |
void |
setUrl(String url)
Sets the url of this NewsFeed
|
void |
synchronizeWithArchive(NewsFeedArchive archive)
Synchronizes this NewsFeed with the specified
NewsFeedArchive. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final long serialVersionUID
The serialVersionUID of this class
protected String url
The url of the NewsFeed
protected SyndFeed originalFeed
The original Rome SyndFeed representation
protected List newsFeedEntries
The List of NewsFeedEntry wrapper objects
| Constructor Detail |
public NewsFeed()
Creates a new empty NewsFeed.
public NewsFeed(String url,
SyndFeed originalFeed)
Creates a new NewsFeed for the newsfeed at the specified
url wrapping up the specified Rome SyndFeed
representation.
url - the url of this NewsFeedoriginalFeed - the original Rome SyndFeed
representation| Method Detail |
public boolean equals(Object obj)
Tests if this NewsFeed is equal to the specified
obj. Two NewsFeed instances are considered
equal if they are both instances of the NewsFeed class and
if both point to the same url as returned by the getUrl()
method.
obj - the Object to be tested against this
NewsFeed for equality
true if this NewsFeed is equal
to the specified obj; false otherwisepublic int hashCode()
Calculates the hashcode of this NewsFeed.
NewsFeedpublic int compareTo(Object obj)
Compares this NewsFeed to another NewsFeed
object based on the published date as returned by the
getPublishedDate() method.
compareTo in interface Comparableobj - a second NewsFeed object to compare this
NewsFeed to
NewsFeed is less than, equal to, or greater than the
specified NewsFeed object.public SyndFeed getOriginalFeed()
Gets the original Rome SyndFeed representation that this
NewsFeed wraps up.
SyndFeed representationpublic void setUrl(String url)
Sets the url of this NewsFeed
url - the url of this NewsFeed.public String getUrl()
Gets the url of this NewsFeed
NewsFeed.public void setTitle(String title)
Sets the feed title.
title - the feed title to set, null if nonepublic String getTitle()
Gets the feed title.
String if none setpublic void setLanguage(String language)
Sets the feed language.
language - the feed language to set, null if nonepublic String getLanguage()
Gets the feed language.
null if nonepublic void setPublishedDate(Date publishedDate)
Sets the feed published date.
publishedDate - the feed published date to set,
null if nonepublic Date getPublishedDate()
Gets the feed published date.
null if nonepublic void setLink(String link)
Sets the feed link.
link - the feed link to set, null if nonepublic String getLink()
Gets the feed link.
null if nonepublic void setDescription(String description)
Sets the feed description.
description - the feed description to set, null if
nonepublic String getDescription()
Gets the feed description.
null if nonepublic void setAuthors(List authors)
Sets the feed authors.
authors - a List of SyndPerson objects
representing the feed authors; null if nonepublic List getAuthors()
Gets the feed authors.
List of SyndPerson objects
representing the feed authors; null if nonepublic void setCopyright(String copyright)
Sets the feed copyright.
copyright - the feed copyright to set, null if nonepublic String getCopyright()
Gets the feed copyright.
null if nonepublic void setImage(SyndImage image)
Sets the feed image.
image - the feed image to set, null if nonepublic SyndImage getImage()
Gets the feed image.
null if nonepublic void setFeedType(String feedType)
Sets the feed type of this NewsFeed
feedType - the feed type to set, null if nonepublic String getFeedType()
Returns the type of this NewsFeed
null if nonepublic void setEncoding(String encoding)
Sets the charset encoding of a the feed. This is not set by Rome parsers.
encoding - the charset encoding of the feedpublic String getEncoding()
Gets the charset encoding of a the feed. This is not set by Rome parsers.
public void setOriginalEntries(List entries)
Sets the original Rome SyndEntry entries.
entries - the list of SyndEntry elements with the
feed entries to set, an empty list or null if nonepublic List getOriginalEntries()
Gets the original Rome SyndEntry entries.
SyndEntry elements with the
original feed entries, an empty list if nonepublic void setEntries(List entries)
Sets the feed entries.
entries - the list of NewsFeedEntry elements with the
feed entries to set, an empty list or null if nonepublic List getEntries()
Gets the feed entries.
NewsFeedEntry elements with the
wrapped feed entries, an empty list if nonepublic int getUnreadCount()
Gets the number of unread news in this NewsFeed.
getUnreadCount in interface INewsFeedStatusNewsFeedpublic int getReadCount()
Gets the number of read news in this NewsFeed.
NewsFeedpublic boolean isUnread()
Returns true if this NewsFeed is unread.
isUnread in interface INewsFeedStatustrue if this NewsFeed is unread;
false otherwisepublic void markAllRead()
Marks all news as read.
public void markAllUnread()
Marks all news as unread.
public NewsFeedEntry[] getUnreadNews()
Gets all unread news of this NewsFeed.
NewsFeed; an empty
array if all read or no news availablepublic NewsFeedEntry[] getReadNews()
Gets all read news of this NewsFeed.
NewsFeed; an empty
array if all unread or no news availablepublic void addToArchive(NewsFeedArchive archive)
Adds this NewsFeed to the specified
NewsFeedArchive. This is done by querying a potential
existing ArchivedNewsFeed and adding all
NewsFeedEntry objects to it. If no
ArchivedNewsFeed yet exists in the specified
NewsFeedArchive a new one has to be created and
filled with this NewsFeed's entries.
addToArchive in interface IArchivablearchive - the NewsFeedArchive to use for
synchronizationNewsFeedArchivepublic void synchronizeWithArchive(NewsFeedArchive archive)
Synchronizes this NewsFeed with the specified
NewsFeedArchive. This is done by reconciling
each embedded NewsFeedEntry with the entries
in a potential archived ArchivedNewsFeed.
synchronizeWithArchive in interface IArchivablearchive - the NewsFeedArchive to use for
synchronizationNewsFeedArchiveprivate void initializeEntries()
Initializes the news embedded in the wrapped SyndFeed
by creating a NewsFeedEntry wrapper object for each single
Rome SyndEntrynews entry.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||