Class TimeFrame
- java.lang.Object
-
- org.apache.wicket.util.time.TimeFrame
-
- All Implemented Interfaces:
Serializable
,ITimeFrameSource
@Deprecated public final class TimeFrame extends Object implements ITimeFrameSource
Deprecated.Since Wicket 9 this class is obsolete and no more used. It will be removed in Wicket 10Immutable 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 theTimeFrame
.TimeFrame
s can be constructed by calling thevalueOf
static factory methodsvalueOf(Time, Time)
(yielding aTimeFrame
between two absolute times) andvalueOf(Time, Duration)
yielding aTimeFrame
starting at an absolute time and having a given length.The start and end of a
TimeFrame
can be retrieved by callinggetStart
andgetEnd
. Its duration can be retrieved by callinggetDuration
.The
contains(Time)
method can be called to determine if aTimeFrame
contains a given point in time. Theoverlaps(TimeFrame)
method can be called to determine if twoTimeFrames
overlap.The
eachDay(TimeOfDay, TimeOfDay)
will return aTimeFrameSource
which generates aTimeFrame
using the two times of day. In other words, if the start is 3pm and the end is 4pm, theTimeFrameSource
returned will yield 3-4pm on the day it is called (each day).- Since:
- 1.2.6
- Author:
- Jonathan Locke
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
contains(Time time)
Deprecated.Determines if thisTimeFrame
contains a given point in time.static ITimeFrameSource
eachDay(TimeOfDay startTimeOfDay, TimeOfDay endTimeOfDay)
Deprecated.Creates anITimeFrameSource
source for start and endTimeOfDay
s.boolean
equals(Object obj)
Deprecated.Duration
getDuration()
Deprecated.Retrieves theDuration
of thisTimeFrame
.Time
getEnd()
Deprecated.Retrieves the endTime
of thisTimeFrame
.Time
getStart()
Deprecated.Retrieves the startTime
of thisTimeFrame
.TimeFrame
getTimeFrame()
Deprecated.Implementation ofITimeFrameSource
that simply returns thisTimeFrame
.int
hashCode()
Deprecated.boolean
overlaps(TimeFrame timeframe)
Deprecated.Determines if twoTimeFrame
s overlap.String
toString()
Deprecated.Converts thisTimeFrame
to aString
representation.static TimeFrame
valueOf(Time start, Duration duration)
Deprecated.Creates aTimeFrame
for a startTime
andDuration
.static TimeFrame
valueOf(Time start, Time end)
Deprecated.Creates aTimeFrame
for given start and endTime
s.
-
-
-
Method Detail
-
eachDay
public static ITimeFrameSource eachDay(TimeOfDay startTimeOfDay, TimeOfDay endTimeOfDay)
Deprecated.Creates anITimeFrameSource
source for start and endTimeOfDay
s. For example, called with 3pm and 5pm as parameters, theTimeFrame
source returned would produceTimeFrame
objects representing 3pm-5pm on whatever day it is when the caller calls theTimeFrameSource
interface.- Parameters:
startTimeOfDay
- the startTimeOfDay
for thisTimeFrame
each dayendTimeOfDay
- the endTimeOfDay
for thisTimeFrame
each day- Returns:
- a
TimeFrameSource
which will return the specifiedTimeFrame
each day
-
valueOf
public static TimeFrame valueOf(Time start, Duration duration)
Deprecated.Creates aTimeFrame
for a startTime
andDuration
.- Parameters:
start
- the startTime
duration
- theDuration
- Returns:
- the
TimeFrame
- Throws:
IllegalArgumentException
- thrown if startTime
value is before endTime
value
-
valueOf
public static TimeFrame valueOf(Time start, Time end)
Deprecated.Creates aTimeFrame
for given start and endTime
s.- Parameters:
start
- the startTime
end
- the endTime
- Returns:
- the
TimeFrame
- Throws:
IllegalArgumentException
- thrown if startTime
value is before endTime
value
-
contains
public boolean contains(Time time)
Deprecated.Determines if thisTimeFrame
contains a given point in time.- Parameters:
time
- theTime
to check- Returns:
true
if thisTimeFrame
contains the given time
-
getDuration
public Duration getDuration()
Deprecated.Retrieves theDuration
of thisTimeFrame
.- Returns:
- the
Duration
of thisTimeFrame
-
getEnd
public Time getEnd()
Deprecated.Retrieves the endTime
of thisTimeFrame
.- Returns:
- the end of this
TimeFrame
-
getStart
public Time getStart()
Deprecated.Retrieves the startTime
of thisTimeFrame
.- Returns:
- the start of this
TimeFrame
-
getTimeFrame
public TimeFrame getTimeFrame()
Deprecated.Implementation ofITimeFrameSource
that simply returns thisTimeFrame
.- Specified by:
getTimeFrame
in interfaceITimeFrameSource
- Returns:
- this
TimeFrame
-
overlaps
public boolean overlaps(TimeFrame timeframe)
Deprecated.Determines if twoTimeFrame
s overlap.- Parameters:
timeframe
- theTimeFrame
to test- Returns:
true
if the givenTimeFrame
overlaps this one
-
-