public class CourseTime extends java.lang.Object implements java.lang.Comparable<CourseTime>
Constructor and Description |
---|
CourseTime(CourseSchedule schedule)
Construct the first valid CourseTime based on the given
CourseSchedule.
|
CourseTime(CourseTime original)
Copy Constructor.
|
CourseTime(int hh,
int mm,
CourseSchedule schedule)
Construct a valid CourseTime (based on the given CourseSchedule)
that occurs on (if possible) or in the first "slot" after
the given time.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CourseTime other)
Compare this CourseTime to another CourseTime
(required by Comparable).
|
static CourseTime |
createLaterCourseTime(CourseTime original,
int minutesLater)
Construct a CourseTime that is the given number of minutes after
a given CourseTime.
|
boolean |
isFirst()
Determine whether this CourseTime is the first possible.
|
boolean |
isLast()
Determine whether this CourseTime is the last possible.
|
java.lang.String |
toString()
Return a String representation this CourseTime
(using "civilian" format).
|
public CourseTime(CourseSchedule schedule)
schedule
- The CourseSchedule to usepublic CourseTime(int hh, int mm, CourseSchedule schedule) throws java.lang.IllegalArgumentException
hh
- The hour of this CourseTime (military format)mm
- The minute of this CoursTimeschedule
- The CourseSchedule being usedjava.lang.IllegalArgumentException
- If the parameters are invalidpublic CourseTime(CourseTime original)
original
- The CourseTime to copypublic static CourseTime createLaterCourseTime(CourseTime original, int minutesLater)
original
- The original CourseTimeminutesLater
- The difference (in minutes) between the twopublic int compareTo(CourseTime other)
compareTo
in interface java.lang.Comparable<CourseTime>
other
- The other CourseTime of interestpublic boolean isFirst()
public boolean isLast()
public java.lang.String toString()
toString
in class java.lang.Object