|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.schedassist.model.AvailableBlockBuilder
public final class AvailableBlockBuilder
Factory for AvailableBlock objects.
| Field Summary | |
|---|---|
protected static int |
MINIMUM_MINUTES
|
protected static Pattern |
TIME_PATTERN
|
protected static String |
TIME_REGEX
|
| Constructor Summary | |
|---|---|
AvailableBlockBuilder()
|
|
| Method Summary | |
|---|---|
static SortedSet<AvailableBlock> |
combine(SortedSet<AvailableBlock> smallBlocks)
Combine adjacent AvailableBlocks in the argument Set. |
protected static long |
convertMinutesToMsec(int minutes)
Convert integer minutes to milliseconds (as long). |
static AvailableBlock |
createBlock(Date startDate,
Date endDate)
Create a single AvailableBlock with a visitorLimit of 1. |
static AvailableBlock |
createBlock(Date startDate,
Date endDate,
int visitorLimit)
Create a single AvailableBlock. |
static AvailableBlock |
createBlock(Date startDate,
Date endDate,
int visitorLimit,
String meetingLocation)
Create a single AvailableBlock. |
static AvailableBlock |
createBlock(String startTimePhrase,
int duration)
Create a single AvailableBlock that starts at the startTime Phrase (uses
CommonDateOperations.parseDateTimePhrase(String) format) and ends duration minutes later. |
static AvailableBlock |
createBlock(String startTimePhrase,
String endTimePhrase)
Create a single AvailableBlock with a visitorLimit of 1 and using this application's common time format ("yyyyMMdd-HHmm")
for the start and end datetimes. |
static AvailableBlock |
createBlock(String startTimePhrase,
String endTimePhrase,
int visitorLimit)
Create a single AvailableBlock using this applications common time format ("yyyyMMdd-HHmm"). |
static AvailableBlock |
createBlock(String startTimePhrase,
String endTimePhrase,
int visitorLimit,
String meetingLocation)
Create a single AvailableBlock using this applications common time format ("yyyyMMdd-HHmm"). |
static AvailableBlock |
createBlockEndsAt(Date endDate,
int duration)
Create a single AvailableBlock that ENDS at the endDate argument and starts duration minutes prior. |
static SortedSet<AvailableBlock> |
createBlocks(String startTimePhrase,
String endTimePhrase,
String daysOfWeekPhrase,
Date startDate,
Date endDate)
Construct a list of AvailableBlock from the following criteria:
startTimePhrase and endTimePhrase should look like HH:MM AM/PM.
daysOfWeekPhrase looks like "MWF" and uses the following characters:
N is Sunday
M is Monday
T is Tuesday
W is Wednesday
R is Thursday
F is Friday
S is Saturday
startDate must exist before endDate on the calendar. |
static SortedSet<AvailableBlock> |
createBlocks(String startTimePhrase,
String endTimePhrase,
String daysOfWeekPhrase,
Date startDate,
Date endDate,
int visitorLimit)
Construct a list of AvailableBlock from the following criteria:
startTimePhrase and endTimePhrase should look like HH:MM AM/PM.
daysOfWeekPhrase looks like "MWF" and uses the following characters:
N is Sunday
M is Monday
T is Tuesday
W is Wednesday
R is Thursday
F is Friday
S is Saturday
startDate must exist before endDate on the calendar. |
static SortedSet<AvailableBlock> |
createBlocks(String startTimePhrase,
String endTimePhrase,
String daysOfWeekPhrase,
Date startDate,
Date endDate,
int visitorLimit,
String meetingLocation)
|
static AvailableBlock |
createMinimumEndBlock(Date endTime)
Creates a minimum size AvailableBlock using the argument endTime as the end and MINIMUM_MINUTES minutes
prior to endTime as the start. |
static AvailableBlock |
createPreferredMinimumDurationBlock(Date startTime,
MeetingDurations preferredMeetingDurations)
Create an AvailableBlock from the specified startTime to an endTime interpreted from MeetingDurations.getMinLength(). |
static AvailableBlock |
createPreferredMinimumDurationBlock(Date startTime,
MeetingDurations preferredMeetingDurations,
int visitorLimit)
Create an AvailableBlock from the specified startTime to an endTime interpreted from MeetingDurations.getMinLength(). |
static AvailableBlock |
createSmallestAllowedBlock(Date startTime)
Creates a minimum size AvailableBlock by adding MINIMUM_MINUTES minutes to startTime as the endTime
and visitorLimit of 1. |
static AvailableBlock |
createSmallestAllowedBlock(Date startTime,
int visitorLimit)
Creates a minimum size AvailableBlock by adding MINIMUM_MINUTES minutes to startTime as the endTime. |
static AvailableBlock |
createSmallestAllowedBlock(String startTimePhrase)
Creates a minimum size AvailableBlock by adding MINIMUM_MINUTES minutes to startTime as the endTime
and visitorLimit of 1. |
static AvailableBlock |
createSmallestAllowedBlock(String startTimePhrase,
int visitorLimit)
Creates a minimum size AvailableBlock by adding MINIMUM_MINUTES minutes to startTime as the endTime. |
static SortedSet<AvailableBlock> |
expand(AvailableBlock largeBlock,
int meetingLengthMinutes)
Expand one AvailableBlock into a SortedSet of AvailableBlocks with a duration equal
to the meetingLengthMinutes argument in minutes. |
static SortedSet<AvailableBlock> |
expand(Set<AvailableBlock> largeBlocks,
int meetingLengthMinutes)
Expand a Set of AvailableBlock into a SortedSet of AvailableBlocks with a duration equal
to the meetingLengthMinutes argument in minutes. |
protected static void |
interpretAndUpdateTime(String timePhrase,
Calendar toModify)
Parses the timePhrase (e.g. |
protected static List<Date> |
matchingDays(String daysOfWeekPhrase,
Date startDate,
Date endDate)
Returns a List of Date objects that fall between startDate and endDate and
exist on the days specified by daysOfWeekPhrase. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String TIME_REGEX
protected static final Pattern TIME_PATTERN
protected static final int MINIMUM_MINUTES
| Constructor Detail |
|---|
public AvailableBlockBuilder()
| Method Detail |
|---|
public static SortedSet<AvailableBlock> createBlocks(String startTimePhrase,
String endTimePhrase,
String daysOfWeekPhrase,
Date startDate,
Date endDate)
throws InputFormatException
AvailableBlock from the following criteria:
startTimePhrase - endTimePhrase - daysOfWeekPhrase - startDate - endDate -
List of AvailableBlocks that fall within the specified date/time criteria.
InputFormatException - if the values for startTimePhrase or endTimePhrase do not match the expected format
public static SortedSet<AvailableBlock> createBlocks(String startTimePhrase,
String endTimePhrase,
String daysOfWeekPhrase,
Date startDate,
Date endDate,
int visitorLimit)
throws InputFormatException
AvailableBlock from the following criteria:
startTimePhrase - endTimePhrase - daysOfWeekPhrase - startDate - endDate - visitorLimit -
List of AvailableBlocks that fall within the specified date/time criteria.
InputFormatException - if the values for startTimePhrase or endTimePhrase do not match the expected format
public static SortedSet<AvailableBlock> createBlocks(String startTimePhrase,
String endTimePhrase,
String daysOfWeekPhrase,
Date startDate,
Date endDate,
int visitorLimit,
String meetingLocation)
throws InputFormatException
startTimePhrase - endTimePhrase - daysOfWeekPhrase - startDate - endDate - visitorLimit - meetingLocation -
InputFormatException
public static AvailableBlock createBlock(Date startDate,
Date endDate)
AvailableBlock with a visitorLimit of 1.
startDate - endDate -
public static AvailableBlock createBlock(Date startDate,
Date endDate,
int visitorLimit)
AvailableBlock.
startDate - endDate - visitorLimit -
public static AvailableBlock createBlock(Date startDate,
Date endDate,
int visitorLimit,
String meetingLocation)
AvailableBlock.
startDate - endDate - visitorLimit - meetingLocation -
public static AvailableBlock createBlock(String startTimePhrase,
String endTimePhrase)
throws InputFormatException
AvailableBlock with a visitorLimit of 1 and using this application's common time format ("yyyyMMdd-HHmm")
for the start and end datetimes.
startTimePhrase - endTimePhrase -
InputFormatExceptionCommonDateOperations.parseDateTimePhrase(String)
public static AvailableBlock createBlock(String startTimePhrase,
String endTimePhrase,
int visitorLimit)
throws InputFormatException
AvailableBlock using this applications common time format ("yyyyMMdd-HHmm").
startTimePhrase - endTimePhrase - visitorLimit -
InputFormatExceptionCommonDateOperations.parseDateTimePhrase(String)
public static AvailableBlock createBlock(String startTimePhrase,
String endTimePhrase,
int visitorLimit,
String meetingLocation)
throws InputFormatException
AvailableBlock using this applications common time format ("yyyyMMdd-HHmm").
startTimePhrase - endTimePhrase - visitorLimit -
InputFormatExceptionCommonDateOperations.parseDateTimePhrase(String)
public static AvailableBlock createBlock(String startTimePhrase,
int duration)
throws InputFormatException
AvailableBlock that starts at the startTime Phrase (uses
CommonDateOperations.parseDateTimePhrase(String) format) and ends duration minutes later.
startTimePhrase - duration -
InputFormatException
public static AvailableBlock createBlockEndsAt(Date endDate,
int duration)
AvailableBlock that ENDS at the endDate argument and starts duration minutes prior.
endDate - end timeduration - how many minutes prior for the start date
public static AvailableBlock createPreferredMinimumDurationBlock(Date startTime,
MeetingDurations preferredMeetingDurations)
AvailableBlock from the specified startTime to an endTime interpreted from MeetingDurations.getMinLength().
visitorLimit for the returned AvailableBlock will be set to 1.
startTime - preferredMeetingDurations -
public static AvailableBlock createPreferredMinimumDurationBlock(Date startTime,
MeetingDurations preferredMeetingDurations,
int visitorLimit)
AvailableBlock from the specified startTime to an endTime interpreted from MeetingDurations.getMinLength().
startTime - preferredMeetingDurations - visitorLimit -
public static AvailableBlock createSmallestAllowedBlock(String startTimePhrase)
throws InputFormatException
AvailableBlock by adding MINIMUM_MINUTES minutes to startTime as the endTime
and visitorLimit of 1.
startTimePhrase -
InputFormatException
public static AvailableBlock createSmallestAllowedBlock(String startTimePhrase,
int visitorLimit)
throws InputFormatException
AvailableBlock by adding MINIMUM_MINUTES minutes to startTime as the endTime.
startTimePhrase - visitorLimit -
InputFormatExceptioncreateSmallestAllowedBlock(Date, int)public static AvailableBlock createSmallestAllowedBlock(Date startTime)
AvailableBlock by adding MINIMUM_MINUTES minutes to startTime as the endTime
and visitorLimit of 1.
startTime -
createSmallestAllowedBlock(Date, int)
public static AvailableBlock createSmallestAllowedBlock(Date startTime,
int visitorLimit)
AvailableBlock by adding MINIMUM_MINUTES minutes to startTime as the endTime.
startTime - visitorLimit -
public static AvailableBlock createMinimumEndBlock(Date endTime)
AvailableBlock using the argument endTime as the end and MINIMUM_MINUTES minutes
prior to endTime as the start.
endTime -
public static SortedSet<AvailableBlock> expand(AvailableBlock largeBlock,
int meetingLengthMinutes)
AvailableBlock into a SortedSet of AvailableBlocks with a duration equal
to the meetingLengthMinutes argument in minutes.
largeBlock -
public static SortedSet<AvailableBlock> expand(Set<AvailableBlock> largeBlocks,
int meetingLengthMinutes)
Set of AvailableBlock into a SortedSet of AvailableBlocks with a duration equal
to the meetingLengthMinutes argument in minutes.
largeBlocks -
public static SortedSet<AvailableBlock> combine(SortedSet<AvailableBlock> smallBlocks)
AvailableBlocks in the argument Set.
smallBlocks -
protected static List<Date> matchingDays(String daysOfWeekPhrase,
Date startDate,
Date endDate)
List of Date objects that fall between startDate and endDate and
exist on the days specified by daysOfWeekPhrase.
For instance, passing "MWF", a start Date of June 30 2008, and an end Date of July 04 2008, this
method will return a list of 3 Date objects (one for Monday June 30, one for Wednesday July 2, and
one for Friday July 4).
The time values for returned Dates will always be 00:00:00 (in the JVM's default timezone).
daysOfWeekPhrase - startDate - endDate -
List of Date objects that fall between startDate and endDate and
exist on the days specified by daysOfWeekPhrase.
protected static void interpretAndUpdateTime(String timePhrase,
Calendar toModify)
throws InputFormatException
timePhrase - toModify -
InputFormatExceptionprotected static long convertMinutesToMsec(int minutes)
minutes -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||