concept.structure
Class ScheduleRestriction
- public class ScheduleRestriction
destroy
public void destroy()
- A destruction method that severs all the links from this restriction.
setBeginningAndEnd
public boolean setBeginningAndEnd(long begin,
long end)
- This is the only method that is allowed access to the ending and beginning attributes of a restriction. This method makes sure that no ending of a restriction takes place before the beginning of the same restriction. If the parameters are in the wrong order, no changes will be made to the attributes and the method returns false.
- Parameters:
begin
- long the proposed beginning
end
- long the proposed ending
- Returns:
- boolean whether the setting was successful
compare
public int compare(concept.structure.ScheduleRestriction crestriction)
- Compares this ScheduleRestriction with another one, based on their starting and ending times.
- Parameters:
crestriction
- ScheduleRestriction The ScheduleRestriction to be compared
- Returns:
- int 0 if either of the two restrictions were of 0 duration, -1 if the restrictions collide 1 if there is no collision and both restrictions were of positive duration
compare
public int compare(long begin,
long end)
- Compares this ScheduleRestriction with a given time period
- Parameters:
begin
- long given start for the time period
end
- long given end for the time period
- Returns:
- int 0 if if given times or restrictions times were of 0 duration -1 if there is a collision 1 if there is no collision