Class 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 10
    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).

    Since:
    1.2.6
    Author:
    Jonathan Locke
    See Also:
    Serialized Form
    • Method Detail

      • eachDay

        public static ITimeFrameSource eachDay​(TimeOfDay startTimeOfDay,
                                               TimeOfDay endTimeOfDay)
        Deprecated.
        Creates an ITimeFrameSource source for start and end TimeOfDays. For example, called with 3pm and 5pm as parameters, the TimeFrame source returned would produce TimeFrame objects representing 3pm-5pm on whatever day it is when the caller calls the TimeFrameSource interface.
        Parameters:
        startTimeOfDay - the start TimeOfDay for this TimeFrame each day
        endTimeOfDay - the end TimeOfDay for this TimeFrame each day
        Returns:
        a TimeFrameSource which will return the specified TimeFrame each day
      • valueOf

        public static TimeFrame valueOf​(Time start,
                                        Duration duration)
        Deprecated.
        Creates a TimeFrame for a start Time and Duration.
        Parameters:
        start - the start Time
        duration - the Duration
        Returns:
        the TimeFrame
        Throws:
        IllegalArgumentException - thrown if start Time value is before end Time value
      • valueOf

        public static TimeFrame valueOf​(Time start,
                                        Time end)
        Deprecated.
        Creates a TimeFrame for given start and end Times.
        Parameters:
        start - the start Time
        end - the end Time
        Returns:
        the TimeFrame
        Throws:
        IllegalArgumentException - thrown if start Time value is before end Time value
      • contains

        public boolean contains​(Time time)
        Deprecated.
        Determines if this TimeFrame contains a given point in time.
        Parameters:
        time - the Time to check
        Returns:
        true if this TimeFrame contains the given time
      • getDuration

        public Duration getDuration()
        Deprecated.
        Retrieves the Duration of this TimeFrame.
        Returns:
        the Duration of this TimeFrame
      • getEnd

        public Time getEnd()
        Deprecated.
        Retrieves the end Time of this TimeFrame.
        Returns:
        the end of this TimeFrame
      • getStart

        public Time getStart()
        Deprecated.
        Retrieves the start Time of this TimeFrame.
        Returns:
        the start of this TimeFrame
      • overlaps

        public boolean overlaps​(TimeFrame timeframe)
        Deprecated.
        Determines if two TimeFrames overlap.
        Parameters:
        timeframe - the TimeFrame to test
        Returns:
        true if the given TimeFrame overlaps this one
      • toString

        public String toString()
        Deprecated.
        Converts this TimeFrame to a String representation.
        Overrides:
        toString in class Object
        Returns:
        a String representation of this object