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.TimeFrames can be constructed by calling thevalueOfstatic factory methodsvalueOf(Time, Time)(yielding aTimeFramebetween two absolute times) andvalueOf(Time, Duration)yielding aTimeFramestarting at an absolute time and having a given length.The start and end of a
TimeFramecan be retrieved by callinggetStartandgetEnd. Its duration can be retrieved by callinggetDuration.The
contains(Time)method can be called to determine if aTimeFramecontains a given point in time. Theoverlaps(TimeFrame)method can be called to determine if twoTimeFramesoverlap.The
eachDay(TimeOfDay, TimeOfDay)will return aTimeFrameSourcewhich generates aTimeFrameusing the two times of day. In other words, if the start is 3pm and the end is 4pm, theTimeFrameSourcereturned 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 booleancontains(Time time)Deprecated.Determines if thisTimeFramecontains a given point in time.static ITimeFrameSourceeachDay(TimeOfDay startTimeOfDay, TimeOfDay endTimeOfDay)Deprecated.Creates anITimeFrameSourcesource for start and endTimeOfDays.booleanequals(Object obj)Deprecated.DurationgetDuration()Deprecated.Retrieves theDurationof thisTimeFrame.TimegetEnd()Deprecated.Retrieves the endTimeof thisTimeFrame.TimegetStart()Deprecated.Retrieves the startTimeof thisTimeFrame.TimeFramegetTimeFrame()Deprecated.Implementation ofITimeFrameSourcethat simply returns thisTimeFrame.inthashCode()Deprecated.booleanoverlaps(TimeFrame timeframe)Deprecated.Determines if twoTimeFrames overlap.StringtoString()Deprecated.Converts thisTimeFrameto aStringrepresentation.static TimeFramevalueOf(Time start, Duration duration)Deprecated.Creates aTimeFramefor a startTimeandDuration.static TimeFramevalueOf(Time start, Time end)Deprecated.Creates aTimeFramefor given start and endTimes.
-
-
-
Method Detail
-
eachDay
public static ITimeFrameSource eachDay(TimeOfDay startTimeOfDay, TimeOfDay endTimeOfDay)
Deprecated.Creates anITimeFrameSourcesource for start and endTimeOfDays. For example, called with 3pm and 5pm as parameters, theTimeFramesource returned would produceTimeFrameobjects representing 3pm-5pm on whatever day it is when the caller calls theTimeFrameSourceinterface.- Parameters:
startTimeOfDay- the startTimeOfDayfor thisTimeFrameeach dayendTimeOfDay- the endTimeOfDayfor thisTimeFrameeach day- Returns:
- a
TimeFrameSourcewhich will return the specifiedTimeFrameeach day
-
valueOf
public static TimeFrame valueOf(Time start, Duration duration)
Deprecated.Creates aTimeFramefor a startTimeandDuration.- Parameters:
start- the startTimeduration- theDuration- Returns:
- the
TimeFrame - Throws:
IllegalArgumentException- thrown if startTimevalue is before endTimevalue
-
valueOf
public static TimeFrame valueOf(Time start, Time end)
Deprecated.Creates aTimeFramefor given start and endTimes.- Parameters:
start- the startTimeend- the endTime- Returns:
- the
TimeFrame - Throws:
IllegalArgumentException- thrown if startTimevalue is before endTimevalue
-
contains
public boolean contains(Time time)
Deprecated.Determines if thisTimeFramecontains a given point in time.- Parameters:
time- theTimeto check- Returns:
trueif thisTimeFramecontains the given time
-
getDuration
public Duration getDuration()
Deprecated.Retrieves theDurationof thisTimeFrame.- Returns:
- the
Durationof thisTimeFrame
-
getEnd
public Time getEnd()
Deprecated.Retrieves the endTimeof thisTimeFrame.- Returns:
- the end of this
TimeFrame
-
getStart
public Time getStart()
Deprecated.Retrieves the startTimeof thisTimeFrame.- Returns:
- the start of this
TimeFrame
-
getTimeFrame
public TimeFrame getTimeFrame()
Deprecated.Implementation ofITimeFrameSourcethat simply returns thisTimeFrame.- Specified by:
getTimeFramein interfaceITimeFrameSource- Returns:
- this
TimeFrame
-
overlaps
public boolean overlaps(TimeFrame timeframe)
Deprecated.Determines if twoTimeFrames overlap.- Parameters:
timeframe- theTimeFrameto test- Returns:
trueif the givenTimeFrameoverlaps this one
-
-