Java java.time Year fields, constructors, methods, implement or subclass

Example usage for Java java.time Year fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.time Year.

The text is from its open source code.

Field

intMIN_VALUE
The minimum supported year, '-999,999,999'.
intMAX_VALUE
The maximum supported year, '+999,999,999'.

Method

TemporaladjustInto(Temporal temporal)
Adjusts the specified temporal object to have this year.
LocalDateatDay(int dayOfYear)
Combines this year with a day-of-year to create a LocalDate .
YearMonthatMonth(Month month)
Combines this year with a month to create a YearMonth .
YearMonthatMonth(int month)
Combines this year with a month to create a YearMonth .
LocalDateatMonthDay(MonthDay monthDay)
Combines this year with a month-day to create a LocalDate .
intcompareTo(Year other)
Compares this year to another year.
booleanequals(Object obj)
Checks if this year is equal to another year.
Stringformat(DateTimeFormatter formatter)
Formats this year using the specified formatter.
Yearfrom(TemporalAccessor temporal)
Obtains an instance of Year from a temporal object.
intget(TemporalField field)
Gets the value of the specified field from this year as an int .
longgetLong(TemporalField field)
Gets the value of the specified field from this year as a long .
inthashCode()
A hash code for this year.
booleanisAfter(Year other)
Checks if this year is after the specified year.
booleanisBefore(Year other)
Checks if this year is before the specified year.
booleanisLeap()
Checks if the year is a leap year, according to the ISO proleptic calendar system rules.
booleanisLeap(long year)
Checks if the year is a leap year, according to the ISO proleptic calendar system rules.
booleanisSupported(TemporalField field)
Checks if the specified field is supported.
booleanisSupported(TemporalUnit unit)
Checks if the specified unit is supported.
booleanisValidMonthDay(MonthDay monthDay)
Checks if the month-day is valid for this year.
intlength()
Gets the length of this year in days.
Yearminus(TemporalAmount amountToSubtract)
Returns a copy of this year with the specified amount subtracted.
Yearminus(long amountToSubtract, TemporalUnit unit)
Returns a copy of this year with the specified amount subtracted.
YearminusYears(long yearsToSubtract)
Returns a copy of this Year with the specified number of years subtracted.
Yearnow()
Obtains the current year from the system clock in the default time-zone.
Yearnow(ZoneId zone)
Obtains the current year from the system clock in the specified time-zone.
Yearnow(Clock clock)
Obtains the current year from the specified clock.
Yearof(int isoYear)
Obtains an instance of Year .
Yearparse(CharSequence text)
Obtains an instance of Year from a text string such as 2007 .
Yearparse(CharSequence text, DateTimeFormatter formatter)
Obtains an instance of Year from a text string using a specific formatter.
Yearplus(TemporalAmount amountToAdd)
Returns a copy of this year with the specified amount added.
Yearplus(long amountToAdd, TemporalUnit unit)
Returns a copy of this year with the specified amount added.
YearplusYears(long yearsToAdd)
Returns a copy of this Year with the specified number of years added.
Rquery(TemporalQuery query)
Queries this year using the specified query.
ValueRangerange(TemporalField field)
Gets the range of valid values for the specified field.
StringtoString()
Outputs this year as a String .
longuntil(Temporal endExclusive, TemporalUnit unit)
Calculates the amount of time until another year in terms of the specified unit.
Yearwith(TemporalAdjuster adjuster)
Returns an adjusted copy of this year.
Yearwith(TemporalField field, long newValue)
Returns a copy of this year with the specified field set to a new value.