Package jmri.jmrit.timetable
Class Schedule
- java.lang.Object
-
- jmri.jmrit.timetable.Schedule
-
public class Schedule extends java.lang.Object
Define the content of a Schedule record.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) TimeTableDataManager
_dm
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Schedule
getCopy(int layoutId)
Make a copy of the schedule.int
getDuration()
java.lang.String
getEffDate()
int
getLayoutId()
int
getScheduleId()
java.lang.String
getScheduleName()
int
getStartHour()
void
setDuration(int newDuration)
Set the duration, 1 - 24 hours.void
setEffDate(java.lang.String newDate)
void
setScheduleName(java.lang.String newName)
void
setStartHour(int newStartHour)
Set the start hour, 0 - 23.java.lang.String
toString()
-
-
-
Constructor Detail
-
Schedule
public Schedule(int layoutId)
Create a new schedule with default values.- Parameters:
layoutId
- The parent layout id.- Throws:
java.lang.IllegalArgumentException
- SCHEDULE_ADD_FAIL
-
Schedule
public Schedule(int scheduleId, int layoutId, java.lang.String scheduleName, java.lang.String effDate, int startHour, int duration)
-
-
Method Detail
-
getCopy
public Schedule getCopy(int layoutId)
Make a copy of the schedule.- Parameters:
layoutId
- The new layoutId, if zero use the current layout id.- Returns:
- a new schedule instance.
-
getScheduleId
public int getScheduleId()
-
getLayoutId
public int getLayoutId()
-
getScheduleName
public java.lang.String getScheduleName()
-
setScheduleName
public void setScheduleName(java.lang.String newName)
-
getEffDate
public java.lang.String getEffDate()
-
setEffDate
public void setEffDate(java.lang.String newDate)
-
getStartHour
public int getStartHour()
-
setStartHour
public void setStartHour(int newStartHour)
Set the start hour, 0 - 23.- Parameters:
newStartHour
- The start hour in the range of 0 to 23.- Throws:
java.lang.IllegalArgumentException
- (START_HOUR_RANGE).
-
getDuration
public int getDuration()
-
setDuration
public void setDuration(int newDuration)
Set the duration, 1 - 24 hours.- Parameters:
newDuration
- The duration in the range of 1 to 24.- Throws:
java.lang.IllegalArgumentException
- (DURATION_RANGE).
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-