|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Weeks
Contains the seven sets of times that make up a week
Field Summary | |
private DayTimeRanges[] |
timeRanges
An array of seven times (each element in the array corresponds to a differnt day of the week and therefore makes up the entire week) |
Constructor Summary | |
Weeks()
Constructs an empty week |
|
Weeks(DayTimeRanges[] initData)
Constructs a week based on pre-determined days |
Method Summary | |
void |
Clear()
Clears the week |
java.lang.Object |
clone()
Makes a copy of the current object |
DayTimeRanges[] |
Get()
Gets the week as an array of seven times |
DayTimeRanges |
GetDay(int day)
Gets the times from a specific day (1=Monday...) |
void |
Set(DayTimeRanges[] newData)
Set new times for the whole week |
void |
SetDay(int day,
DayTimeRanges newData)
Set times to a specific day |
Methods inherited from class java.lang.Object |
|
Field Detail |
private DayTimeRanges[] timeRanges
Constructor Detail |
public Weeks()
Preconditions: (none)
Postconditions: A new week with seven empty time ranges will be constructed
public Weeks(DayTimeRanges[] initData)
Preconditions: initData is an array of size 7
Postconditions: initData will be used to create the new Weeks object.
initData[0] will be copied into Monday ... initData[6] will be copied into Sunday
(this contradicts our usual standard where 1=Monday)
initData
- an array of seven times to be assigned
to the weekMethod Detail |
public DayTimeRanges[] Get()
Preconditions: (none)
Postconditions: The method will return the array of seven times that make up the week
public DayTimeRanges GetDay(int day)
Preconditions: day is within the valid range 1-7 where 1=Monday
Postconditions: The time range for that given day will be returned
day
- day to get times frompublic void SetDay(int day, DayTimeRanges newData)
Preconditions: day is within the valid range 1-7 where 1=Monday
Postconditions: The time range information for the given day will be set to the given newData
day
- day to set times tonewData
- new times to assign to the specified daypublic void Clear()
Preconditions: (none)
Postconditions: Every time range (for every day of the week) will be cleared
public void Set(DayTimeRanges[] newData)
Preconditions: newData is an array of size 7
Postconditions: The week will be set to the information specified in the newData
newData
- new times for the whole week, an array of
seven timespublic java.lang.Object clone()
Preconditions: (none)
Postconditions: The method will make a copy of the current object and return the copy
clone
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |