com.ora.jsp.beans.motd
Class MixedMessageBean

java.lang.Object
  extended bycom.ora.jsp.beans.motd.MixedMessageBean
All Implemented Interfaces:
java.io.Serializable

public class MixedMessageBean
extends java.lang.Object
implements java.io.Serializable

This is an example of a bean with one writeable property for selecting a message category and one readable property that cycles through messages in the selected category.

Version:
1.0
Author:
Hans Bergsten, Gefion software
See Also:
Serialized Form

Field Summary
private  java.lang.String category
           
private static int quoteIndex
           
private  java.util.List quotes
           
private static int thoughtIndex
           
private  java.util.List thoughts
           
 
Constructor Summary
MixedMessageBean()
          Contructor that initializes the data structures that hold the messages.
 
Method Summary
 java.lang.String getMessage()
          Returns a new message from the selected category every time it's called, cycling through all available messages.
private  void initMessageLists()
          Creates and initalizes the data structures that hold the messages.
 void setCategory(java.lang.String category)
          Sets the message category, one of "quotes" or "thoughts".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

quoteIndex

private static int quoteIndex

thoughtIndex

private static int thoughtIndex

quotes

private java.util.List quotes

thoughts

private java.util.List thoughts

category

private java.lang.String category
Constructor Detail

MixedMessageBean

public MixedMessageBean()
Contructor that initializes the data structures that hold the messages.

Method Detail

setCategory

public void setCategory(java.lang.String category)
Sets the message category, one of "quotes" or "thoughts".


getMessage

public java.lang.String getMessage()
Returns a new message from the selected category every time it's called, cycling through all available messages.


initMessageLists

private void initMessageLists()
Creates and initalizes the data structures that hold the messages.