|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectmonthlyCalendar.MonthlyCalendar
public class MonthlyCalendar
This class provides the basic functionality associated with a monthly calendar. We have implemented this class for you and you should not modify it.
| Constructor Summary | |
|---|---|
MonthlyCalendar(Month month,
int maxNumberDays,
Day firstDay)
Initializes the MonthlyCalendar object using the specified parameters. |
|
| Method Summary | |
|---|---|
boolean |
addActivity(java.lang.String name,
Date date,
Time activityStartTime,
int duration)
Verifies whether the specified time period is available and if so, adds the activity to the list of activities for that date. |
boolean |
anyActivitiesOnDay(Date date)
Returns true if there are any activities scheduled during the specified date and false otherwise. |
java.util.Iterator<Activity> |
dayActivitiesIterator(Date date)
Returns an Activity iterator for the activities in the specified date |
Activity |
getActivity(Date date,
Time activityStartTime)
Returns a reference to the Activity that takes place at the specified date and that starts at the specified time. |
int |
getDaysInFirstWeek()
Returns the number of days in the first week of the month. |
java.util.Map<Day,java.util.Map<Time,Activity>> |
getDayTimeActivityMap(int weekNumber)
This methods returns a map that allow us to tell what activity takes place in a week, at a particular day and at a particular start time. |
Day |
getFirstDay()
Returns the first day of the month. |
Month |
getMonth()
Returns the calendar's month. |
int |
getNumberOfDays()
Returns the number of days in the month. |
int |
getNumberOfWeeks()
Returns the number of weeks associated with the month. |
boolean |
isTimePeriodAvailable(Date date,
Time activityStartTime,
int duration)
Returns true if it is possible to schedule an activity on the specified date, in the time period starting at activityStartTime and lasting for the specified duration (minutes). |
boolean |
isValidDate(Date date)
Returns true if the date is considered a valid date for the month associated with the calendar. |
boolean |
removeActivity(Date date,
Time activityStartTime)
Removes the activity taking place at the specified date and start time. |
java.lang.String |
toString()
Returns a string representation for the calendar. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MonthlyCalendar(Month month,
int maxNumberDays,
Day firstDay)
month - maxNumberDays - maximum number of days in the monthfirstDay - first day of the month| Method Detail |
|---|
public boolean isTimePeriodAvailable(Date date,
Time activityStartTime,
int duration)
date - date activity will take placeactivityStartTime - start timeduration - duration of activity in minutes
public boolean addActivity(java.lang.String name,
Date date,
Time activityStartTime,
int duration)
name - activity's namedate - date to schedule activityactivityStartTime - start timeduration - duration in minutes
public Activity getActivity(Date date,
Time activityStartTime)
date - date activity will take placeactivityStartTime - start time
public boolean removeActivity(Date date,
Time activityStartTime)
date - date activity will take placeactivityStartTime - start time
public java.util.Iterator<Activity> dayActivitiesIterator(Date date)
date - target date
java.lang.IllegalArgumentException - Thrown if the specified date has no
activities associated with it.public boolean anyActivitiesOnDay(Date date)
date - target date
public java.util.Map<Day,java.util.Map<Time,Activity>> getDayTimeActivityMap(int weekNumber)
weekNumber - week number
public java.lang.String toString()
toString in class java.lang.Objectpublic Month getMonth()
public Day getFirstDay()
public int getNumberOfDays()
public int getDaysInFirstWeek()
public int getNumberOfWeeks()
public boolean isValidDate(Date date)
date -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||