Class TimeSpan

  • All Implemented Interfaces:
    Copy<ch.poole.openinghoursparser.Element>

    public class TimeSpan
    extends java.lang.Object
    Container for objects from the opening_hours specification
    • Constructor Detail

      • TimeSpan

        public TimeSpan()
        Default constructor
      • TimeSpan

        public TimeSpan​(@NotNull
                        @NotNull TimeSpan ts)
        Construct a new TimeSpan with the same contents
        Parameters:
        ts - the original TimeSpan
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
      • hashCode

        public int hashCode()
      • getStart

        public int getStart()
        Returns:
        the start time in minutes
      • getStartEvent

        public VariableTime getStartEvent()
        Returns:
        the startEvent
      • getEnd

        public int getEnd()
        Returns:
        the end time in minutes
      • getEndEvent

        public VariableTime getEndEvent()
        Returns:
        the endEvent
      • isOpenEnded

        public boolean isOpenEnded()
        Returns:
        the openEnded
      • getInterval

        public int getInterval()
        Returns:
        the interval
      • setStart

        public void setStart​(int s)
        Set the start of range value
        Parameters:
        s - the start value to set
      • setStartEvent

        public void setStartEvent​(VariableTime startEvent)
        Parameters:
        startEvent - the startEvent to set
      • setEnd

        public void setEnd​(int e)
        Set the end of range value
        Parameters:
        e - the end value to set
      • setEndEvent

        public void setEndEvent​(VariableTime endEvent)
        Parameters:
        endEvent - the endEvent to set
      • setOpenEnded

        public void setOpenEnded​(boolean openEnded)
        Parameters:
        openEnded - the openEnded to set
      • setInterval

        public void setInterval​(int interval)
        Parameters:
        interval - the interval to set
      • copy

        public TimeSpan copy()
        Description copied from interface: Copy
        Create a copy of the objecz
        Returns:
        a copy of the object
      • toDebugString

        public java.lang.String toDebugString()
        Create a string that identifies which class created it for debugging and testing
        Returns:
        the output of toString with the class name prepended