Immutable class which represents an interval of time with a beginning and an
end. The beginning value is inclusive and the end value is exclusive. In
other words, the time frame of 1pm to 2pm includes 1pm, but not 2pm. 1:59:59
is the last value in the timeframe.
TimeFrames can be constructed by calling the valueOf static factory methods
valueOf(Time, Time) (yielding a TimeFrame between two absolute times) and
valueOf(Time, Duration) yielding a TimeFrame starting at an absolute time and
having a given length.
The start and end of a TimeFrame can be retrieved by calling getStart() and
getEnd(). Its duration can be retrieved by calling getDuration().
The contains(Time) method can be called to determine if a TimeFrame contains
a given point in time. The overlaps(TimeFrame) method can be called to
determine if two TimeFrames overlap.
The eachDay(TimeOfDay, TimeOfDay) will return a TimeFrameSource which
generates a timeframe using the two times of day. In other words, if the
start is 3pm and the end is 4pm, the TimeFrameSource returned will yield
3-4pm on the day it is called (each day).
author: Jonathan Locke |