us.souther.select
Class HolidayDB
java.lang.Object
us.souther.select.HolidayDB
public class HolidayDB
- extends java.lang.Object
Mock database that returns a list of Holiday Objects.
In order to keep this demonstration project entirely contained within
a war file, the database had to be mimicked with this object.
The point was not to demonstrate how to store data in Java object.
I almost left this source file out of the war file because I didn't
want people getting too caught up in how it works. The code that is
meant to be studied is in HolidaySelectorServlet.java, HolidayBean.java and
the index.jsp page.
Legal Notice:
This code was written for demonstration purposes only.
The author of this code assumes no responsibility for damage resulting in
it's use. You may do whatever you like with it but at your own risk.
It is your responsibility to understand how it works and determine if it is
dependable enough, stable enough, and secure enough for your intended purpose.
- Since:
- Sat Apr 23 15:56:51 EDT 2005
- Author:
- Ben Souther; ben@souther.us
Method Summary |
void |
addHoliday(int month,
int day,
java.lang.String name)
|
Holiday |
getHoliday(java.lang.Object key)
returns a Holiday object |
static void |
main(java.lang.String[] args)
|
java.util.ArrayList |
selectByMonth(int month)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HolidayDB
public HolidayDB()
addHoliday
public void addHoliday(int month,
int day,
java.lang.String name)
getHoliday
public Holiday getHoliday(java.lang.Object key)
- returns a Holiday object
- Parameters:
key
- the key for the holiday object.
selectByMonth
public java.util.ArrayList selectByMonth(int month)
- Parameters:
month
- use Holiday constants.
- Returns:
- an array list of Holiday objects sorted by date.
main
public static void main(java.lang.String[] args)