com.ora.jsp.beans.news
Class NewsBean
java.lang.Object
|
+--com.ora.jsp.beans.news.NewsBean
- All Implemented Interfaces:
- java.io.Serializable
- public class NewsBean
- extends java.lang.Object
- implements java.io.Serializable
This class maintains a list of NewsItemBean objects. It's
only intended as an example. A real implementation would
use a database to keep track of the objects instead.
- Version:
- 1.0
- Author:
- Hans Bergsten, Gefion software
- See Also:
- Serialized Form
Constructor Summary |
NewsBean()
Creates a new instance and fills it with a few sample
news items. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
newsItems
private java.util.Vector newsItems
idSequence
private int[] idSequence
NewsBean
public NewsBean()
- Creates a new instance and fills it with a few sample
news items.
getNewsItems
public NewsItemBean[] getNewsItems(java.lang.String[] categories)
- Returns an array of all items in the specified categories.
setNewsItem
public void setNewsItem(NewsItemBean newsItem)
- Adds a news item to the list.
removeNewsItem
public void removeNewsItem(int id)
- Removes the new item with the specified id.
addDefaultItems
private void addDefaultItems()
- Creates sample news items and adds them to the list.