Package org.joda.time

Interface ReadWritableInterval

    • Method Detail

      • setInterval

        void setInterval​(long startInstant,
                         long endInstant)
        Sets this interval from two millisecond instants.
        Parameters:
        startInstant - the start of the time interval
        endInstant - the start of the time interval
        Throws:
        java.lang.IllegalArgumentException - if the end is before the start
      • setInterval

        void setInterval​(ReadableInterval interval)
        Sets this interval to be the same as another.
        Parameters:
        interval - the interval to copy
        Throws:
        java.lang.IllegalArgumentException - if the end is before the start
      • setInterval

        void setInterval​(ReadableInstant startInstant,
                         ReadableInstant endInstant)
        Sets this interval from two instants.
        Parameters:
        startInstant - the start of the time interval
        endInstant - the start of the time interval
        Throws:
        java.lang.IllegalArgumentException - if the end is before the start
      • setChronology

        void setChronology​(Chronology chrono)
        Sets the chronology of this time interval.
        Parameters:
        chrono - the chronology to use, null means ISO default
      • setStartMillis

        void setStartMillis​(long millisInstant)
        Sets the start of this time interval.
        Parameters:
        millisInstant - the start of the time interval, millisecond instant from 1970-01-01T00:00:00Z
        Throws:
        java.lang.IllegalArgumentException - if the end is before the start
      • setStart

        void setStart​(ReadableInstant instant)
        Sets the start of this time interval as an Instant.
        Parameters:
        instant - the start of the time interval
        Throws:
        java.lang.IllegalArgumentException - if the end is before the start
      • setEndMillis

        void setEndMillis​(long millisInstant)
        Sets the end of this time interval.
        Parameters:
        millisInstant - the end of the time interval, millisecond instant from 1970-01-01T00:00:00Z
        Throws:
        java.lang.IllegalArgumentException - if the end is before the start
      • setEnd

        void setEnd​(ReadableInstant instant)
        Sets the end of this time interval as an Instant.
        Parameters:
        instant - the end of the time interval
        Throws:
        java.lang.IllegalArgumentException - if the end is before the start
      • setDurationAfterStart

        void setDurationAfterStart​(ReadableDuration duration)
        Sets the duration of this time interval, preserving the start instant.
        Parameters:
        duration - new duration for interval
        Throws:
        java.lang.IllegalArgumentException - if the end is before the start
        java.lang.ArithmeticException - if the end instant exceeds the capacity of a long
      • setDurationBeforeEnd

        void setDurationBeforeEnd​(ReadableDuration duration)
        Sets the duration of this time interval, preserving the end instant.
        Parameters:
        duration - new duration for interval
        Throws:
        java.lang.IllegalArgumentException - if the end is before the start
        java.lang.ArithmeticException - if the start instant exceeds the capacity of a long
      • setPeriodAfterStart

        void setPeriodAfterStart​(ReadablePeriod period)
        Sets the period of this time interval, preserving the start instant.
        Parameters:
        period - new period for interval, null means zero length
        Throws:
        java.lang.IllegalArgumentException - if the end is before the start
        java.lang.ArithmeticException - if the end instant exceeds the capacity of a long
      • setPeriodBeforeEnd

        void setPeriodBeforeEnd​(ReadablePeriod period)
        Sets the period of this time interval, preserving the end instant.
        Parameters:
        period - new period for interval, null means zero length
        Throws:
        java.lang.IllegalArgumentException - if the end is before the start
        java.lang.ArithmeticException - if the start instant exceeds the capacity of a long