com.ora.jsp.beans.news
Class NewsBean

java.lang.Object
  extended bycom.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:
2.0
Author:
Hans Bergsten, Gefion software
See Also:
Serialized Form

Field Summary
private  int[] idSequence
           
private  java.util.ArrayList newsItems
           
 
Constructor Summary
NewsBean()
          Creates a new instance and fills it with a few sample news items.
 
Method Summary
private  void addDefaultItems()
          Creates sample news items and adds them to the list.
 NewsItemBean[] getNewsItems()
          Returns an array of all items.
 void removeNewsItem(int id)
          Removes the news item with the specified id.
 void setNewsItem(NewsItemBean newsItem)
          Adds a news item to the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

newsItems

private java.util.ArrayList newsItems

idSequence

private int[] idSequence
Constructor Detail

NewsBean

public NewsBean()
Creates a new instance and fills it with a few sample news items.

Method Detail

getNewsItems

public NewsItemBean[] getNewsItems()
Returns an array of all items.


setNewsItem

public void setNewsItem(NewsItemBean newsItem)
Adds a news item to the list.


removeNewsItem

public void removeNewsItem(int id)
Removes the news item with the specified id.


addDefaultItems

private void addDefaultItems()
Creates sample news items and adds them to the list.