|
WPI GDC CMS 0.0.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.wpi.gdc.cms.main.NewsStory
A news story.
Field Summary | |
static int |
FIELD_ABSTRACT
The story abstract field. |
static int |
FIELD_AUTHOR
The story author field. |
static int |
FIELD_BODY
The story body field. |
static int |
FIELD_HEADLINE
The story headline field. |
static int |
FIELD_ID
The story ID field. |
static int |
FIELD_POSTED
The story posted field. |
static int |
FIELD_TOPIC
The story topic field. |
Constructor Summary | |
NewsStory(int id,
User author,
Topic topic,
java.util.Calendar posted,
java.lang.String headline,
java.lang.String abstractBody,
java.lang.String fullBody)
Creates a new NewsStory based on the passed values. |
Method Summary | |
java.lang.String |
getAbstract()
Gets the abstract of the story. |
User |
getAuthor()
Gets the author of the article. |
java.lang.String |
getBody()
Gets the full body of the story. |
java.lang.String |
getHeadline()
Gets the headline of the story. |
int |
getID()
Gets the ID of the news story. |
java.util.Calendar |
getPosted()
Gets the time the story was posted. |
Topic |
getTopic()
Gets the Topic object for this story. |
void |
setAbstract(java.lang.String abstractBody)
Sets the abstract of the story. |
void |
setAuthor(User author)
Sets the author of the article. |
void |
setBody(java.lang.String fullBody)
Sets the full body of the story. |
void |
setHeadline(java.lang.String headline)
Sets the headline of the story. |
void |
setID(int id)
Sets the story ID. |
void |
setPosted(java.util.Calendar posted)
Sets the time the story was posted. |
void |
setTopic(Topic topic)
Sets the Topic object for this story. |
java.lang.String |
toString()
Creates a string that represents the fields in the story. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int FIELD_ID
getID()
public static final int FIELD_AUTHOR
getAuthor()
public static final int FIELD_TOPIC
getTopic()
public static final int FIELD_POSTED
getPosted()
public static final int FIELD_HEADLINE
getHeadline()
public static final int FIELD_ABSTRACT
getAbstract()
public static final int FIELD_BODY
getBody()
Constructor Detail |
public NewsStory(int id, User author, Topic topic, java.util.Calendar posted, java.lang.String headline, java.lang.String abstractBody, java.lang.String fullBody)
id
- the ID of the story; set to a negative number for a story
to be inserted into the DB layer.author
- the author of the storytopic
- the topic this story belongs toposted
- when the story was postedheadline
- the story's headlineabstractBody
- a shorter version of the storyfullBody
- the full version of the storyMethod Detail |
public int getID()
The ID is used both for references and as the ID in the database.
public User getAuthor()
public Topic getTopic()
public java.util.Calendar getPosted()
If the returned time is null
, then the story has not been posted yet.
null
if it hasn't
been postedpublic java.lang.String getHeadline()
public java.lang.String getAbstract()
The abstract is a shorter version of the full body and is usually displayed on listing of stories.
public java.lang.String getBody()
The full body is often longer than the abstract, and should be displayed separate from other stories.
public void setID(int id)
This may have consequences if changed randomly - changing the ID will NOT change the ID in the database, it will most likely be left in the DB with the old ID. Setting the id to a negative number will cause the story to replicated in the database.
id
- the new IDpublic void setAuthor(User author)
author
- the authorpublic void setTopic(Topic topic)
topic
- the new topicpublic void setPosted(java.util.Calendar posted)
Setting the time to null
indicates it hasn't been posted yet.
posted
- the time the story was posted or null
if it hasn't
been postedpublic void setHeadline(java.lang.String headline)
headline
- the headlineNullPointerException
- if headline is nullpublic void setAbstract(java.lang.String abstractBody)
The abstract is a shorter version of the full body and is usually displayed on listing of stories.
abstractBody
- the new abstract bodyNullPointerException
- if abstractBody is nullpublic void setBody(java.lang.String fullBody)
The full body is often longer than the abstract, and should be displayed separate from other stories.
fullBody
- the full body of the storyNullPointerException
- if fullBody is nullpublic java.lang.String toString()
toString
in class java.lang.Object
|
WPI GDC CMS 0.0.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |