CS 1705 Library

cs1705.web
Class RssFeed

java.lang.Object
  extended by cs1705.web.RssFeed
All Implemented Interfaces:
RssEntity, Serializable, Cloneable

public class RssFeed
extends Object
implements RssEntity, Serializable, Cloneable

This class represents a syndication feed that contains a list of RssEntry objects.

Version:
2007.09.01
Author:
Stephen Edwards
See Also:
Serialized Form

Constructor Summary
RssFeed()
          Creates a new RssFeed object that is completely empty.
RssFeed(RssFeed existingFeed)
          Creates a new RssFeed object by copying from an existing one.
RssFeed(String url)
          Creates a new RssFeed object by reading from the given URL.
RssFeed(URL url)
          Creates a new RssFeed object by reading from the given URL.
 
Method Summary
 void addEntry(RssEntry entry)
          Add a new entry to this feed.
 Object clone()
          Clone this object.
 String getAuthor()
          Get this feed's author.
 List<String> getAuthors()
          Get this feed's authors.
 Date getDate()
          Get this feed's publication date.
 String getDescription()
          Get this feed's description.
 List<RssEntry> getEntries()
          Get this feed's entries.
 URL getIconLink()
          Get the link for the site icon belonging to this feed's home site.
 URL getImageLink()
          Get the link for this feed's image as a URL.
 URL getLink()
          Get the link (as a URL) where this feed is officially published.
 URL getLoadedFromLink()
          Get the link as a URL where this feed was loaded from.
 String getTitle()
          Get this feed's title.
 void setAuthor(String author)
          Set this feed's author.
 void setAuthors(List<String> authors)
          Set this feed's authors.
 void setDate(Date date)
          Set this feed's publication date.
 void setDescription(String description)
          Set this feed's description.
 void setEntries(List<RssEntry> entries)
          Set this feed's entries.
 void setIconLink(URL link)
          Set the link for the site icon belonging to this feed's home site.
 void setImageLink(URL link)
          Set this link for this feed's image.
 void setLink(URL link)
          Set this feed's publication link.
 void setLoadedFromLink(URL link)
          Set the value this feed believes it was loaded from (normally set by the constructor).
 void setTitle(String title)
          Set this feed's title.
 String toString()
          Generate a printable version of this feed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RssFeed

public RssFeed()
Creates a new RssFeed object that is completely empty.


RssFeed

public RssFeed(String url)
Creates a new RssFeed object by reading from the given URL.

Parameters:
url - The URL to read from, as a string

RssFeed

public RssFeed(URL url)
Creates a new RssFeed object by reading from the given URL.

Parameters:
url - The URL to read from, as a string

RssFeed

public RssFeed(RssFeed existingFeed)
Creates a new RssFeed object by copying from an existing one. Subclasses should override this constructor if they add their own data, so that their internal subclass data gets initialized properly.

Parameters:
existingFeed - The feed to copy
Method Detail

getAuthor

public String getAuthor()
Get this feed's author. If there are multiple authors, this method returns the first one.

Specified by:
getAuthor in interface RssEntity
Returns:
This feed's author

setAuthor

public void setAuthor(String author)
Set this feed's author.

Specified by:
setAuthor in interface RssEntity
Parameters:
author - This feed's author

getAuthors

public List<String> getAuthors()
Get this feed's authors.

Specified by:
getAuthors in interface RssEntity
Returns:
This feed's authors

setAuthors

public void setAuthors(List<String> authors)
Set this feed's authors.

Specified by:
setAuthors in interface RssEntity
Parameters:
authors - A list of this feed's authors

getDate

public Date getDate()
Get this feed's publication date.

Specified by:
getDate in interface RssEntity
Returns:
This feed's date

setDate

public void setDate(Date date)
Set this feed's publication date.

Specified by:
setDate in interface RssEntity
Parameters:
date - This feed's date

getDescription

public String getDescription()
Get this feed's description.

Specified by:
getDescription in interface RssEntity
Returns:
This feed's description

setDescription

public void setDescription(String description)
Set this feed's description.

Specified by:
setDescription in interface RssEntity
Parameters:
description - The new description

getEntries

public List<RssEntry> getEntries()
Get this feed's entries.

Returns:
This feed's entries

addEntry

public void addEntry(RssEntry entry)
Add a new entry to this feed.

Parameters:
entry - The new entry to add

setEntries

public void setEntries(List<RssEntry> entries)
Set this feed's entries.

Parameters:
entries - This feed's entries

getIconLink

public URL getIconLink()
Get the link for the site icon belonging to this feed's home site. This icon is often used in browsers and so on to identify the feed's site.

Returns:
The feed's icon URL, which points to the home site's "favicon.ico" icon (which may not even exist, of course)

setIconLink

public void setIconLink(URL link)
Set the link for the site icon belonging to this feed's home site.

Parameters:
link - The new URL to use

getImageLink

public URL getImageLink()
Get the link for this feed's image as a URL.

Returns:
The feed's image URL, or null if there is none

setImageLink

public void setImageLink(URL link)
Set this link for this feed's image.

Parameters:
link - The new URL to use

getLoadedFromLink

public URL getLoadedFromLink()
Get the link as a URL where this feed was loaded from.

Returns:
The link's URL, or null if there is none

setLoadedFromLink

public void setLoadedFromLink(URL link)
Set the value this feed believes it was loaded from (normally set by the constructor).

Parameters:
link - The new URL to use

getLink

public URL getLink()
Get the link (as a URL) where this feed is officially published.

Specified by:
getLink in interface RssEntity
Returns:
The link's URL, or null if there is none

setLink

public void setLink(URL link)
Set this feed's publication link.

Specified by:
setLink in interface RssEntity
Parameters:
link - The new URL to use

getTitle

public String getTitle()
Get this feed's title.

Specified by:
getTitle in interface RssEntity
Returns:
The feed's title

setTitle

public void setTitle(String title)
Set this feed's title.

Specified by:
setTitle in interface RssEntity
Parameters:
title - The feed's title

clone

public Object clone()
Clone this object.

Overrides:
clone in class Object
Returns:
a copy of this object

toString

public String toString()
Generate a printable version of this feed.

Overrides:
toString in class Object
Returns:
the string representation of this object

Last updated: Wed, Apr 1, 2009 • 12:29 AM EDT

Copyright © 2009 Virginia Tech.