|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSchedule
public class Schedule
A Schedule consists of a title and a collection of Event objects.
A Schedule object is mutable. That is, its attributes can be changed.
Constructor Summary | |
---|---|
Schedule(java.lang.String title,
int maxSize)
Explicit Value Constructor |
Method Summary | |
---|---|
void |
add(Event e)
Add an Event object to this Schedule (of there is space). |
Event[] |
getEvents()
Get all of the Event objects in this Schedule, some of which may be null (i.e., the array is of length maxSize) |
java.lang.String |
getTitle()
Get the title of this Schedule |
int |
size()
Get the current size of this Schedule (i.e., the number of Event objects that are currently in this Schedule) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Schedule(java.lang.String title, int maxSize)
title
- The title of this SchedulemaxSize
- The largest possible number of Event objectsMethod Detail |
---|
public void add(Event e)
Add an Event object to this Schedule (of there is space). If there is no space, this method does nothing.
Note that a Schedule can contain events that overlap. That is, suppose this Schedule has an Event from 9:00-10:00, this method will allow you to add an Event that has an Event from 9:30-10:30. This increases the flexibility of this class. Hence, an application that does not support overlapping events must check before calling the add() method.
e
- The Event to addpublic Event[] getEvents()
public java.lang.String getTitle()
public int size()
|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |