All Implemented Interfaces:
Serializable, ChronoPeriod, TemporalAmount

  • Field Summary

    Fields

    A constant for a period of zero.

  • Method Summary

    Adds this period to the specified temporal object.

    Obtains a Period consisting of the number of years, months, and days between two dates.

    boolean

    Checks if this period is equal to another period.

    Obtains an instance of Period from a temporal amount.

    long

    Gets the value of the requested unit.

    Gets the chronology of this period, which is the ISO calendar system.

    int

    getDays()

    Gets the amount of days of this period.

    int

    getMonths()

    Gets the amount of months of this period.

    getUnits()

    Gets the set of units supported by this period.

    int

    getYears()

    Gets the amount of years of this period.

    int

    hashCode()

    A hash code for this period.

    boolean

    Checks if any of the three units of this period are negative.

    boolean

    isZero()

    Checks if all three units of this period are zero.

    Returns a copy of this period with the specified period subtracted.

    minusDays(long daysToSubtract)

    Returns a copy of this period with the specified days subtracted.

    minusMonths(long monthsToSubtract)

    Returns a copy of this period with the specified months subtracted.

    minusYears(long yearsToSubtract)

    Returns a copy of this period with the specified years subtracted.

    multipliedBy(int scalar)

    Returns a new instance with each element in this period multiplied by the specified scalar.

    negated()

    Returns a new instance with each amount in this period negated.

    Returns a copy of this period with the years and months normalized.

    of(int years, int months, int days)

    Obtains a Period representing a number of years, months and days.

    ofDays(int days)

    Obtains a Period representing a number of days.

    ofMonths(int months)

    Obtains a Period representing a number of months.

    ofWeeks(int weeks)

    Obtains a Period representing a number of weeks.

    ofYears(int years)

    Obtains a Period representing a number of years.

    Obtains a Period from a text string such as PnYnMnD.

    Returns a copy of this period with the specified period added.

    plusDays(long daysToAdd)

    Returns a copy of this period with the specified days added.

    plusMonths(long monthsToAdd)

    Returns a copy of this period with the specified months added.

    plusYears(long yearsToAdd)

    Returns a copy of this period with the specified years added.

    Subtracts this period from the specified temporal object.

    toString()

    Outputs this period as a String, such as P6Y3M1D.

    long

    Gets the total number of months in this period.

    withDays(int days)

    Returns a copy of this period with the specified amount of days.

    withMonths(int months)

    Returns a copy of this period with the specified amount of months.

    withYears(int years)

    Returns a copy of this period with the specified amount of years.

    Methods declared in class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Creates and returns a copy of this object.

    protected void

    Deprecated, for removal: This API element is subject to removal in a future version.

    Returns the runtime class of this Object.

    final void

    Wakes up a single thread that is waiting on this object's monitor.

    final void

    Wakes up all threads that are waiting on this object's monitor.

    final void

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

    final void

    wait(long timeoutMillis)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

    final void

    wait(long timeoutMillis, int nanos)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

  • Field Details

    • ZERO

  • Method Details

    • ofYears

    • ofMonths

    • ofWeeks

    • ofDays

    • of

    • from

    • parse

    • between

    • get

    • getUnits

    • getChronology

    • isZero

    • isNegative

    • getYears

    • getMonths

    • getDays

    • withYears

    • withMonths

    • withDays

    • plus

    • plusYears

    • plusMonths

    • plusDays

    • minus

    • minusYears

    • minusMonths

    • minusDays

    • multipliedBy

    • negated

    • normalized

    • toTotalMonths

    • addTo

    • subtractFrom

    • equals

    • hashCode

    • toString