Year (Java SE 26 & JDK 26)
- All Implemented Interfaces:
Serializable, Comparable<Year>, Temporal, TemporalAccessor, TemporalAdjuster
-
Field Summary
Fields
static final intThe maximum supported year, '+999,999,999'.
static final intThe minimum supported year, '-999,999,999'.
-
Method Summary
Adjusts the specified temporal object to have this year.
atDay(int dayOfYear) Combines this year with a day-of-year to create a
LocalDate.atMonth(int month) Combines this year with a month to create a
YearMonth.Combines this year with a month to create a
YearMonth.Combines this year with a month-day to create a
LocalDate.intCompares this year to another year.
booleanChecks if this year is equal to another year.
Formats this year using the specified formatter.
Obtains an instance of
Yearfrom a temporal object.intGets the value of the specified field from this year as an
int.longGets the value of the specified field from this year as a
long.intgetValue()inthashCode()A hash code for this year.
booleanChecks if this year is after the specified year.
booleanChecks 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.
static booleanisLeap(long year) Checks if the year is a leap year, according to the ISO proleptic calendar system rules.
booleanChecks if the specified field is supported.
booleanChecks if the specified unit is supported.
booleanChecks if the month-day is valid for this year.
intlength()Gets the length of this year in days.
Returns a copy of this year with the specified amount subtracted.
Returns a copy of this year with the specified amount subtracted.
minusYears(long yearsToSubtract) Returns a copy of this
Yearwith the specified number of years subtracted.now()Obtains the current year from the system clock in the default time-zone.
Obtains the current year from the specified clock.
Obtains the current year from the system clock in the specified time-zone.
of(int isoYear) Obtains an instance of
Year.Obtains an instance of
Yearfrom a text string such as2007.Obtains an instance of
Yearfrom a text string using a specific formatter.Returns a copy of this year with the specified amount added.
Returns a copy of this year with the specified amount added.
plusYears(long yearsToAdd) Returns a copy of this
Yearwith the specified number of years added.<R> RQueries this year using the specified query.
Gets the range of valid values for the specified field.
toString()Outputs this year as a
String.longCalculates the amount of time until another year in terms of the specified unit.
Returns an adjusted copy of this year.
Returns a copy of this year with the specified field set to a new value.
Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitCreates and returns a copy of this object.
protected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(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 voidwait(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
-
MIN_VALUE
-
MAX_VALUE
-
-
Method Details
-
now
-
now
-
now
-
of
-
from
-
parse
-
parse
-
isLeap
-
getValue
-
isSupported
-
isSupported
-
range
-
get
-
getLong
-
isLeap
-
isValidMonthDay
-
length
-
with
-
with
-
plus
-
plus
-
plusYears
-
minus
-
minus
-
minusYears
-
query
-
adjustInto
-
until
-
format
-
atDay
-
atMonth
-
atMonth
-
atMonthDay
-
compareTo
-
isAfter
-
isBefore
-
equals
-
hashCode
-
toString
-