|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEvent
public class Event
An Event object has a description, the days of the week on which it occurs, a start time, and an end time. For example, an Event in a university course scheduling application might be a lecture that occurs on Monday, Wednesday and Friday from 9:00 to 9:50. As another example, an Event in a digital video recorder application might be a show that airs on Thursdays from 8:00 to 9:00.
An Event object is immutable. That is, once it is created, its attributes can't be changed.
Constructor Summary | |
---|---|
Event(java.lang.String description,
java.lang.String days,
java.lang.String times)
Explicit Value Constructor |
Method Summary | |
---|---|
boolean |
conflicts(Event other)
Return true if this Event conflicts/overlaps with the Event named other. |
java.lang.String |
toString()
Returns a String representation of this Event. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Event(java.lang.String description, java.lang.String days, java.lang.String times) throws java.lang.IllegalArgumentException
Explicit Value Constructor
For convenience, this constructor is passed String parameters. If there are problems with the parameters, this constructor will throw an IllegalArgumentException.
If the Event occurs on more than one day, the individual days must be comma-delimited (e.g., "M,W,F"). A day can be spelled-out or abbreviated. If an abbreviation is ambiguous (e.g., "T") the earliest match will be used (e.g., "Tuesday" for "T").
The start and end times of the Event must be formatted as hh:mm-hh:mm and the end time must not be before the start time.
description
- The description of the Eventdays
- The days of the Event (comma delimited)times
- The times of the Event (hh:mm-hh:mm)
java.lang.IllegalArgumentException
Method Detail |
---|
public boolean conflicts(Event other)
other
- The other Event to consider
public java.lang.String toString()
toString
in class java.lang.Object
|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |