|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmodel.Article
public class Article
The Article class represents an article from an RSS feed. This class has two types of instantiations, one created directly from the database and one created by the parser. The latter has less knowledge of its environment (and in particular it has no database id number).
| Field Summary | |
|---|---|
private java.lang.String |
author
|
private boolean |
hasId
|
private int |
id
|
private boolean |
inOutbox
|
private boolean |
inTrash
|
private int |
parentid
|
private java.util.Date |
pubDate
|
private int |
rating
|
private boolean |
read
|
private java.lang.String |
summary
|
private java.lang.String |
title
|
private java.lang.String |
url
|
| Constructor Summary | |
|---|---|
Article(int id,
int parentid,
java.lang.String author,
java.lang.String title,
java.lang.String url,
java.lang.String summary,
java.util.Date pubDate,
boolean read,
boolean trash,
boolean outbox,
int rating)
Constructor takes input information and constructs an Article object with a given id. |
|
Article(java.lang.String author,
java.lang.String title,
java.lang.String url,
java.lang.String summary,
java.util.Date pubDate)
Constructor takes input information and constructs an Article object. |
|
| Method Summary | |
|---|---|
java.lang.String |
getAuthor()
Get the article's author. |
int |
getId()
Gets the article's id, if it was created in such a way that it has an id (i.e. |
int |
getParentid()
Returns the article's parent id. |
java.util.Date |
getPubDate()
Gets the article's published date, supplied on construction. |
int |
getRating()
Returns the article's rating, an integer. |
boolean |
getRead()
Returns the read status of the article. |
java.lang.String |
getSummary()
Gets the article's summary, which is the (optional) bit of content displayed beneath the article's title in the mailbox view. |
java.lang.String |
getTitle()
Gets the article's title. |
java.lang.String |
getUrl()
Gets the article's url, supplied on construction. |
private boolean |
hasId()
Tests if article knows its id (basically tests if this article was returned by the database) |
boolean |
isInOutbox()
Tests to see if the article is in the outbox. |
boolean |
isInTrash()
Tests to see if the article is in the trash. |
boolean |
isSame(Article a)
Compares an article to another given article. |
void |
markRead(boolean read)
Marks the article as read. |
void |
setInOutbox(boolean inOutbox)
Sets the article's in-outbox status. |
void |
setInTrash(boolean inTrash)
Sets the article's trashed status. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String author
private java.lang.String title
private java.lang.String url
private java.lang.String summary
private java.util.Date pubDate
private boolean read
private boolean inTrash
private boolean inOutbox
private boolean hasId
private int rating
private int id
private int parentid
| Constructor Detail |
|---|
public Article(java.lang.String author,
java.lang.String title,
java.lang.String url,
java.lang.String summary,
java.util.Date pubDate)
author - Author of article; If null, it is set to the empty stringtitle - Title of article; If null, it is set to the empty stringurl - URL of full article; If null, it is set to the empty stringsummary - Text summary of article; If null, it is set to the empty stringpubDate - Date that article was published. If null, it is passed along as null.
public Article(int id,
int parentid,
java.lang.String author,
java.lang.String title,
java.lang.String url,
java.lang.String summary,
java.util.Date pubDate,
boolean read,
boolean trash,
boolean outbox,
int rating)
id - Internal id number for the article. (From a database; guaranteed to be unique.)parentid - Internal id number for the article's parent.author - Author of article. If null, becomes the empty string.title - Title of article. If null, becomes the empty string.url - URL of full article. If null, becomes the empty string.summary - Text summary of article. If null, becomes the empty string.pubDate - Date that article was published. If null, is passed along as a null date.read - Whether or not the article has been read yet.trash - Whether or not this article is in the trash.outbox - Whether or not this article is in the outbox.rating - The article's rating.| Method Detail |
|---|
public void markRead(boolean read)
read - The new read status of the article (true->read, false->unread)public boolean isSame(Article a)
a - Article to be compared.
private boolean hasId()
public java.lang.String getAuthor()
public java.util.Date getPubDate()
public java.lang.String getSummary()
public java.lang.String getTitle()
public java.lang.String getUrl()
public int getId()
throws java.lang.IllegalAccessException
java.lang.IllegalAccessException - if this article has no id (this means the article wasn't made from the database)public boolean getRead()
public int getRating()
public int getParentid()
public boolean isInTrash()
public void setInTrash(boolean inTrash)
inTrash - boolean New trash status of the articlepublic void setInOutbox(boolean inOutbox)
inOutbox - boolean New outbox status of the articlepublic boolean isInOutbox()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||