org.threeten.bp

Year

object Year extends Serializable

Annotations
@SerialVersionUID( 23038383694477807L )
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
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val MAX_VALUE: Int

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

  7. val MIN_VALUE: Int

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

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

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

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

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

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

    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 ChronoField#YEAR 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}

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

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

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

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

    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

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

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

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

    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 Clock dependency injection.

    clock

    the clock to use, not null

    returns

    the current year, not null

  22. def now(zone: ZoneId): Year

    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 Clock#system(ZoneId) 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

  23. def now: Year

    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 Clock#systemDefaultZone() 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

  24. def of(isoYear: Int): Year

    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

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

    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

  26. def parse(text: CharSequence): Year

    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

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

    Definition Classes
    AnyRef
  28. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped