Object/Class

org.threeten.bp

Year

Related Docs: class Year | package bp

Permalink

object Year extends Serializable

Annotations
@SerialVersionUID()
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Year
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. lazy val MAX_VALUE: Int

    Permalink

    The maximum supported year, '+999,999,999'.

  5. lazy val MIN_VALUE: Int

    Permalink

    The minimum supported year, '-999,999,999'.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def from(temporal: TemporalAccessor): Year

    Permalink

    Obtains an instance of Year from a temporal object.

    Obtains an instance of Year from a temporal object.

    A TemporalAccessor represents some form of date and time information. This factory converts the arbitrary temporal object to an instance of Year.

    The conversion extracts the year field. The extraction is only permitted if the temporal object has an ISO chronology, or can be converted to a LocalDate.

    This method matches the signature of the functional interface TemporalQuery allowing it to be used in queries via method reference, Year::from.

    temporal

    the temporal object to convert, not null

    returns

    the year, not null

    Exceptions thrown

    DateTimeException if unable to convert to a { @code Year}

  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. def isLeap(year: Long): Boolean

    Permalink

    Checks if the year is a leap year, according to the ISO proleptic calendar system rules.

    Checks if the year is a leap year, according to the ISO proleptic calendar system rules.

    This method applies the current rules for leap years across the whole time-line. In general, a year is a leap year if it is divisible by four without remainder. However, years divisible by 100, are not leap years, with the exception of years divisible by 400 which are.

    For example, 1904 is a leap year it is divisible by 4. 1900 was not a leap year as it is divisible by 100, however 2000 was a leap year as it is divisible by 400.

    The calculation is proleptic - applying the same rules into the far future and far past. This is historically inaccurate, but is correct for the ISO-8601 standard.

    year

    the year to check

    returns

    true if the year is leap, false otherwise

  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. def now(clock: Clock): Year

    Permalink

    Obtains the current year from the specified clock.

    Obtains the current year from the specified clock.

    This will query the specified clock to obtain the current year. Using this method allows the use of an alternate clock for testing. The alternate clock may be introduced using dependency injection.

    clock

    the clock to use, not null

    returns

    the current year, not null

  20. def now(zone: ZoneId): Year

    Permalink

    Obtains the current year from the system clock in the specified time-zone.

    Obtains the current year from the system clock in the specified time-zone.

    This will query the system clock to obtain the current year. Specifying the time-zone avoids dependence on the default time-zone.

    Using this method will prevent the ability to use an alternate clock for testing because the clock is hard-coded.

    zone

    the zone ID to use, not null

    returns

    the current year using the system clock, not null

  21. def now: Year

    Permalink

    Obtains the current year from the system clock in the default time-zone.

    Obtains the current year from the system clock in the default time-zone.

    This will query the system clock in the default time-zone to obtain the current year.

    Using this method will prevent the ability to use an alternate clock for testing because the clock is hard-coded.

    returns

    the current year using the system clock and default time-zone, not null

  22. def of(isoYear: Int): Year

    Permalink

    Obtains an instance of Year.

    Obtains an instance of Year.

    This method accepts a year value from the proleptic ISO calendar system.

    The year 2AD/CE is represented by 2.
    The year 1AD/CE is represented by 1.
    The year 1BC/BCE is represented by 0.
    The year 2BC/BCE is represented by -1.

    isoYear

    the ISO proleptic year to represent, from { @code MIN_VALUE} to { @code MAX_VALUE}

    returns

    the year, not null

    Exceptions thrown

    DateTimeException if the field is invalid

  23. def parse(text: CharSequence, formatter: DateTimeFormatter): Year

    Permalink

    Obtains an instance of Year from a text string using a specific formatter.

    Obtains an instance of Year from a text string using a specific formatter.

    The text is parsed using the formatter, returning a year.

    text

    the text to parse, not null

    formatter

    the formatter to use, not null

    returns

    the parsed year, not null

    Exceptions thrown

    DateTimeParseException if the text cannot be parsed

  24. def parse(text: CharSequence): Year

    Permalink

    Obtains an instance of Year from a text string such as 2007.

    Obtains an instance of Year from a text string such as 2007.

    The string must represent a valid year. Years outside the range 0000 to 9999 must be prefixed by the plus or minus symbol.

    text

    the text to parse such as "2007", not null

    returns

    the parsed year, not null

    Exceptions thrown

    DateTimeParseException if the text cannot be parsed

  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped