buttress.rss
Class RssItem

java.lang.Object
  extended bybuttress.rss.RssItem
All Implemented Interfaces:
java.lang.Comparable

public class RssItem
extends java.lang.Object
implements java.lang.Comparable


Field Summary
static java.lang.String EMPTY
           
static java.util.Date EMPTY_DATE
           
static java.lang.String EMPTY_URL
           
 
Constructor Summary
RssItem()
          Default Constructor
RssItem(java.lang.String t, java.lang.String u)
          Constructor to set title and url
RssItem(java.lang.String t, java.lang.String u, boolean n)
          Constructor to set title, url and new
RssItem(java.lang.String t, java.lang.String u, boolean n, java.util.Date date)
           
RssItem(java.lang.String t, java.lang.String d, java.lang.String u)
          Creates new instance with parameters
RssItem(java.lang.String t, java.lang.String d, java.lang.String u, boolean n)
          Constructor.
RssItem(java.lang.String t, java.lang.String d, java.lang.String u, boolean n, java.util.Date date)
           
RssItem(java.lang.String title, java.lang.String description, java.lang.String location, boolean newItem, double fileSize, java.util.Date lastUpdated)
          Constructor with all parameters.
 
Method Summary
 int compareTo(java.lang.Object o)
          compares two rssitems
 boolean equals(java.lang.Object other)
          tests whether two RssItems are equal
 java.lang.String getDescription()
          gets description value
 double getFileSize()
           
 java.util.Date getLastUpdated()
           
 java.net.URL getLocation()
          gets location value
 java.net.URL getParentFeed()
           
 java.lang.String getTitle()
          gets title value
 int hashCode()
          Generates a hashCode to represent this object
 boolean isNew()
          gets the boolean value of the item
 void setDescription(java.lang.String newDescription)
          sets value of description
 void setFileSize(double fileSize)
           
 void setLastUpdated(java.util.Date lastUpdated)
           
 boolean setLocation(java.lang.String newLocation)
          sets value of location
 void setNew(boolean isNew)
          sets item's new status
 void setParentFeed(java.net.URL parentFeed)
           
 void setTitle(java.lang.String newTitle)
          sets value of title
 java.lang.String toString()
          string of rssitem values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final java.lang.String EMPTY
See Also:
Constant Field Values

EMPTY_URL

public static final java.lang.String EMPTY_URL
See Also:
Constant Field Values

EMPTY_DATE

public static final java.util.Date EMPTY_DATE
Constructor Detail

RssItem

public RssItem()
        throws java.net.MalformedURLException
Default Constructor

Throws:
java.net.MalformedURLException

RssItem

public RssItem(java.lang.String t,
               java.lang.String u)
        throws java.net.MalformedURLException
Constructor to set title and url

Parameters:
t - title
u - url
Throws:
java.net.MalformedURLException

RssItem

public RssItem(java.lang.String t,
               java.lang.String u,
               boolean n)
        throws java.net.MalformedURLException
Constructor to set title, url and new

Parameters:
t - title
u - url
n - boolean

RssItem

public RssItem(java.lang.String t,
               java.lang.String d,
               java.lang.String u)
        throws java.net.MalformedURLException
Creates new instance with parameters

Parameters:
t - title
d - description
u - url

RssItem

public RssItem(java.lang.String t,
               java.lang.String d,
               java.lang.String u,
               boolean n)
        throws java.net.MalformedURLException
Constructor.

Parameters:
t -
d -
u -
n -

RssItem

public RssItem(java.lang.String t,
               java.lang.String u,
               boolean n,
               java.util.Date date)
        throws java.net.MalformedURLException
Parameters:
t -
u -
n -
date -
Throws:
java.net.MalformedURLException

RssItem

public RssItem(java.lang.String t,
               java.lang.String d,
               java.lang.String u,
               boolean n,
               java.util.Date date)
        throws java.net.MalformedURLException
Parameters:
t -
d -
u -
n -
date -
Throws:
java.net.MalformedURLException

RssItem

public RssItem(java.lang.String title,
               java.lang.String description,
               java.lang.String location,
               boolean newItem,
               double fileSize,
               java.util.Date lastUpdated)
        throws java.net.MalformedURLException
Constructor with all parameters.

Parameters:
title -
description -
location -
newItem -
fileSize -
lastUpdated -
Method Detail

getTitle

public java.lang.String getTitle()
gets title value

Returns:
title

getDescription

public java.lang.String getDescription()
gets description value

Returns:
description

getLocation

public java.net.URL getLocation()
gets location value

Returns:
location

getParentFeed

public java.net.URL getParentFeed()
Returns:
Returns the parentFeed.

setParentFeed

public void setParentFeed(java.net.URL parentFeed)
Parameters:
parentFeed - The parentFeed to set.

setTitle

public void setTitle(java.lang.String newTitle)
sets value of title

Parameters:
newTitle -

setDescription

public void setDescription(java.lang.String newDescription)
sets value of description

Parameters:
newDescription -

setLocation

public boolean setLocation(java.lang.String newLocation)
sets value of location

Parameters:
newLocation -
Returns:
whether or not the location could be set. (false if and only if there was a MalformedURLException)

setNew

public void setNew(boolean isNew)
sets item's new status


getFileSize

public double getFileSize()
Returns:
Returns the fileSize.

setFileSize

public void setFileSize(double fileSize)
Parameters:
fileSize - The fileSize to set.

getLastUpdated

public java.util.Date getLastUpdated()
Returns:
Returns the lastUpdated.

setLastUpdated

public void setLastUpdated(java.util.Date lastUpdated)
Parameters:
lastUpdated - The lastUpdated to set.

isNew

public boolean isNew()
gets the boolean value of the item

Returns:
newItem boolean

toString

public java.lang.String toString()
string of rssitem values

Returns:
string

compareTo

public int compareTo(java.lang.Object o)
compares two rssitems

Specified by:
compareTo in interface java.lang.Comparable
Returns:
0 if same -1 if less than, 1 if more than

equals

public boolean equals(java.lang.Object other)
tests whether two RssItems are equal

Ignores whether or not the item is new.

Parameters:
other - another RssItem

hashCode

public int hashCode()
Generates a hashCode to represent this object

Returns:
the hashCode for this object