Results 1 to 2 of 2
Thread: Writing the filter method
- 07-03-2007, 03:56 PM #1Member
- Join Date
- Jun 2007
- Rep Power
Writing the filter method
I have created a class 'Organizer' that has filter methods that are supposed to :
a) display list of events between any two days.
b) display wedding anniversaries and birth day events.
c) Display events for any month.
The 'Organizer' class collects information like, date, name, hphone, email, type of relation and event (stack/Q) type through filing methods.
There is an ADT class 'Event' that has information: event type and date.
There is an ADT class 'Dear' that has information: name, hphone, email, type of relation and event(stack/Q) type.
How do I display only list of events between two dates(a)?
And for (b), is this correct :
if((b[i] == wedding anniversaries)|| (b[i] == birthdays)) return b[i];
Last edited by ai_2007; 07-03-2007 at 03:59 PM.
- 07-03-2007, 04:32 PM #2
For (a), check the following tip:
Java Tips - Compare two dates
You will just need to compare all dates with the given dates and only display the events between these two dates.
The logic of (b) looks correct. For (c), you can display the events that will be performed between the start and end date of the given month.