public class Year
extends Object
GDK enhancements for Year.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public int |
getEra()Equivalent to calling the Year.get method with a ChronoField.ERA argument. |
|
public int |
getYearOfEra()Equivalent to calling the Year.get method with a ChronoField.YEAR_OF_ERA argument. |
|
public YearMonth |
leftShift(Month month)Returns a YearMonth of this year and the provided Month. |
|
public LocalDate |
leftShift(MonthDay monthDay)Returns a LocalDate of this year on the given MonthDay. |
|
public Year |
minus(long years)Returns a Year that is years years before this year. |
|
public Year |
next()Returns a Year after this year. |
|
public static Year |
parse(Year type, CharSequence text, String pattern)Parse text into a Year using the provided pattern. |
|
public Year |
plus(long years)Returns a Year that is years years after this year. |
|
public Year |
previous()Returns a Year before this year. |
|
public Period |
rightShift(Year year)Returns a Period between the first day of this year (inclusive) and the first day of the provided Year (exclusive). |
| Methods inherited from class | Name |
|---|---|
class Object |
addShutdownHook, any, any, asBoolean, asType, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits |
Equivalent to calling the Year.get method with a ChronoField.ERA argument.
Returns the era of the year, which is currently either 0 (BC) or 1 (AD).
Equivalent to calling the Year.get method with a ChronoField.YEAR_OF_ERA argument.
Since Year=0 represents 1 BC, the yearOfEra value of Year=0 is 1, Year=-1 is 2, and so on.
Returns a YearMonth of this year and the provided Month.
month - a MonthReturns a LocalDate of this year on the given MonthDay.
monthDay - a MonthDay Returns a Year that is years years before this year.
years - the number of years to subtractParse text into a Year using the provided pattern.
type - placeholder variable used by Groovy categories; ignored for default static methodstext - String to be parsed to create the date instancepattern - pattern used to parse the text Returns a Year that is years years after this year.
years - the number of years to add