Example usage for Java java.time Year fields, constructors, methods, implement or subclass
The text is from its open source code.
int | MIN_VALUE The minimum supported year, '-999,999,999'. |
int | MAX_VALUE The maximum supported year, '+999,999,999'. |
Temporal | adjustInto(Temporal temporal) Adjusts the specified temporal object to have this year. |
LocalDate | atDay(int dayOfYear) Combines this year with a day-of-year to create a LocalDate . |
YearMonth | atMonth(Month month) Combines this year with a month to create a YearMonth . |
YearMonth | atMonth(int month) Combines this year with a month to create a YearMonth . |
LocalDate | atMonthDay(MonthDay monthDay) Combines this year with a month-day to create a LocalDate . |
int | compareTo(Year other) Compares this year to another year. |
boolean | equals(Object obj) Checks if this year is equal to another year. |
String | format(DateTimeFormatter formatter) Formats this year using the specified formatter. |
Year | from(TemporalAccessor temporal) Obtains an instance of Year from a temporal object. |
int | get(TemporalField field) Gets the value of the specified field from this year as an int . |
long | getLong(TemporalField field) Gets the value of the specified field from this year as a long . |
int | hashCode() A hash code for this year. |
boolean | isAfter(Year other) Checks if this year is after the specified year. |
boolean | isBefore(Year other) Checks if this year is before the specified year. |
boolean | isLeap() Checks if the year is a leap year, according to the ISO proleptic calendar system rules. |
boolean | isLeap(long year) Checks if the year is a leap year, according to the ISO proleptic calendar system rules. |
boolean | isSupported(TemporalField field) Checks if the specified field is supported. |
boolean | isSupported(TemporalUnit unit) Checks if the specified unit is supported. |
boolean | isValidMonthDay(MonthDay monthDay) Checks if the month-day is valid for this year. |
int | length() Gets the length of this year in days. |
Year | minus(TemporalAmount amountToSubtract) Returns a copy of this year with the specified amount subtracted. |
Year | minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this year with the specified amount subtracted. |
Year | minusYears(long yearsToSubtract) Returns a copy of this Year with the specified number of years subtracted. |
Year | now() Obtains the current year from the system clock in the default time-zone. |
Year | now(ZoneId zone) Obtains the current year from the system clock in the specified time-zone. |
Year | now(Clock clock) Obtains the current year from the specified clock. |
Year | of(int isoYear) Obtains an instance of Year . |
Year | parse(CharSequence text) Obtains an instance of Year from a text string such as 2007 . |
Year | parse(CharSequence text, DateTimeFormatter formatter) Obtains an instance of Year from a text string using a specific formatter. |
Year | plus(TemporalAmount amountToAdd) Returns a copy of this year with the specified amount added. |
Year | plus(long amountToAdd, TemporalUnit unit) Returns a copy of this year with the specified amount added. |
Year | plusYears(long yearsToAdd) Returns a copy of this Year with the specified number of years added. |
R | query(TemporalQuery Queries this year using the specified query. |
ValueRange | range(TemporalField field) Gets the range of valid values for the specified field. |
String | toString() Outputs this year as a String . |
long | until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another year in terms of the specified unit. |
Year | with(TemporalAdjuster adjuster) Returns an adjusted copy of this year. |
Year | with(TemporalField field, long newValue) Returns a copy of this year with the specified field set to a new value. |