org.jasig.schedassist.model
Class VisibleScheduleRequestConstraints
java.lang.Object
org.jasig.schedassist.model.VisibleScheduleRequestConstraints
- All Implemented Interfaces:
- Serializable
public class VisibleScheduleRequestConstraints
- extends Object
- implements Serializable
Java bean to encapsulate the derived fields from a request to view
an IScheduleOwner's visible schedule.
- Version:
- $Id: VisibleScheduleDisplayRequestDetails.java $
- Author:
- Nicholas Blair, nblair@doit.wisc.edu
- See Also:
- Serialized Form
WEEKS_PER_PAGE
public static final int WEEKS_PER_PAGE
- See Also:
- Constant Field Values
getTargetStartDate
public Date getTargetStartDate()
- Returns:
- the targetStartDate
getTargetEndDate
public Date getTargetEndDate()
- Returns:
- the targetEndDate
getNextWeekIndex
public Integer getNextWeekIndex()
- Returns:
- the nextWeekIndex
getPrevWeekIndex
public Integer getPrevWeekIndex()
- Returns:
- the prevWeekIndex
getConstrainedWeekStart
public int getConstrainedWeekStart()
- Returns:
- the constrainedWeekStart
toString
public String toString()
- Overrides:
toString in class Object
newInstance
public static VisibleScheduleRequestConstraints newInstance(IScheduleOwner owner,
int weekStart)
- Use this method to construct a
VisibleScheduleRequestConstraints, which
enforces all the appropriate constraints.
- Parameters:
owner - the target IScheduleOwner for the requestweekStart - an integer representing the number of weeks forward to start the request, 0 meaning "now"
- Returns:
- an appropriate VisibleScheduleRequestConstraints for the owner.
constrainWeekStartToWindow
protected static int constrainWeekStartToWindow(VisibleWindow window,
int weekStart)
- Parameters:
window - weekStart -
- Returns:
- return a weekStart value that falls within the VisibleWindow argument
calculateNextWeekIndex
protected static Integer calculateNextWeekIndex(VisibleWindow window,
int weekStart)
- Parameters:
window - weekStart -
- Returns:
- increment weekStart if possible; return null if incrementing would put weekStart outside visible window
calculatePrevWeekIndex
protected static Integer calculatePrevWeekIndex(VisibleWindow window,
int weekStart)
- Parameters:
window - weekStart -
- Returns:
- decrement weekStart if possible; return null if decrementing would put weekStart outside visible window
resolveStartDate
protected static Date resolveStartDate(Date referencePoint,
int weekStart)
- Parameters:
referencePoint - weekStart -
- Returns:
- add an appropriate number of days and weeks to the referencepoint based on the weekStart argument
resolveEndDate
protected static Date resolveEndDate(VisibleWindow window,
Date start)
- Parameters:
window - start -
- Returns:
- an appropriate end date that falls within the visible window
Copyright © 2012 Jasig. All Rights Reserved.