@CalendarType(value="iso8601") public final class CalendarQuarter extends FixedCalendarInterval<CalendarQuarter> implements LocalizedPatternSupport
Represents the quarter of a gregorian calendar year as interval (like from 1st of January until end of March).
The elements registered by this class are:
Note: The current quarter of calendar year can be determined by an expression like:
nowInSystemTime() or in a more general way
CalendarQuarter current = SystemClock.inLocalView().now(CalendarQuarter.chronology()).
| Modifier and Type | Field and Description |
|---|---|
static ChronoElement<Quarter> |
QUARTER_OF_YEAR
Element with the quarter of year in the value range
Q1-Q4. |
static ChronoElement<Integer> |
YEAR
Element with the proleptic iso-year without any era reference and
the value range
-999999999 until 999999999. |
| Modifier and Type | Method and Description |
|---|---|
PlainDate |
atDayOfQuarter(int dayOfQuarter)
Combines this calendar quarter with given day of quarter year to a calendar date.
|
PlainDate |
atEndOfQuarter()
Yields the date of the end of this quarter year.
|
static Chronology<CalendarQuarter> |
chronology()
Yields the associated chronology.
|
int |
compareTo(CalendarQuarter other) |
boolean |
contains(PlainDate temporal)
Queries if given time point belongs to this interval.
|
boolean |
equals(Object obj) |
static CalendarQuarter |
from(GregorianDate date)
Converts given gregorian date to a quarter year.
|
Boundary<PlainDate> |
getEnd()
Yields the upper bound of this interval.
|
Quarter |
getQuarter()
Yields the quarter year.
|
Boundary<PlainDate> |
getStart()
Yields the lower bound of this interval.
|
int |
getYear()
Yields the year number.
|
int |
hashCode() |
boolean |
isAfter(PlainDate temporal)
Is this interval after the given time point?
|
boolean |
isBefore(PlainDate temporal)
Is this interval before the given time point?
|
Iterator<PlainDate> |
iterator()
Iterates over all days of this calendar quarter year.
|
int |
length()
Ermittelt die Anzahl der Tage, die zu diesem Kalenderquartal gehören.
|
CalendarQuarter |
minus(Quarters quarters)
Subtracts given quarter years from this quarter year.
|
CalendarQuarter |
minus(Years<CalendarUnit> years)
Subtracts given years from this quarter year.
|
static CalendarQuarter |
nowInSystemTime()
Obtains the current calendar quarter year in system time.
|
static CalendarQuarter |
of(int year,
Quarter quarter)
Creates a new instance based on given gregorian calendar year and quarter year.
|
CalendarQuarter |
plus(Quarters quarters)
Adds given quarter years to this quarter year.
|
CalendarQuarter |
plus(Years<CalendarUnit> years)
Adds given years to this quarter year.
|
String |
toString()
Outputs this instance as a String in CLDR-format "uuuu-'Q'Q" (like "2016-Q1").
|
abuts, contains, isBefore, isEmpty, isFinite, isSimultaneous, streamDaily, toFlexInterval, withValuecontains, get, get, getInt, getMaximum, getMinimum, getRegisteredElements, getTimezone, hasTimezone, isValid, isValid, isValid, matches, with, with, with, withintersects, isAfterforEach, spliterator@FormattableElement(format="u") public static final ChronoElement<Integer> YEAR
Element with the proleptic iso-year without any era reference and
the value range -999999999 until 999999999.
The term "proleptic" means that the rules of the gregorian
calendar and the associated way of year counting is applied backward
even before the introduction of gregorian calendar. The year 0
is permitted - and negative years, too. For historic year numbers,
this mathematical extrapolation is not recommended and usually
wrong.
@FormattableElement(format="Q", standalone="q") public static final ChronoElement<Quarter> QUARTER_OF_YEAR
Element with the quarter of year in the value range
Q1-Q4.
public static CalendarQuarter of(int year, Quarter quarter)
Creates a new instance based on given gregorian calendar year and quarter year.
year - gregorian year within range -999,999,999 / +999,999,999quarter - quarter yearIllegalArgumentException - if given year is out of rangepublic static CalendarQuarter nowInSystemTime()
Obtains the current calendar quarter year in system time.
Convenient short-cut for: SystemClock.inLocalView().now(CalendarQuarter.chronology()).
SystemClock.inLocalView(),
ZonalClock.now(net.time4j.engine.Chronology)public PlainDate atDayOfQuarter(int dayOfQuarter)
Combines this calendar quarter with given day of quarter year to a calendar date.
dayOfQuarter - day of quarter in range 1-90/91/92IllegalArgumentException - if the day-of-quarter is out of rangepublic PlainDate atEndOfQuarter()
Yields the date of the end of this quarter year.
public int getYear()
Yields the year number.
public Quarter getQuarter()
Yields the quarter year.
public Boundary<PlainDate> getStart()
ChronoIntervalYields the lower bound of this interval.
getStart in interface ChronoInterval<PlainDate>public Boundary<PlainDate> getEnd()
ChronoIntervalYields the upper bound of this interval.
getEnd in interface ChronoInterval<PlainDate>public boolean contains(PlainDate temporal)
ChronoIntervalQueries if given time point belongs to this interval.
contains in interface ChronoInterval<PlainDate>temporal - time point to be queriedtrue if given time point belongs to this interval else falsepublic boolean isAfter(PlainDate temporal)
ChronoIntervalIs this interval after the given time point?
isAfter in interface ChronoInterval<PlainDate>temporal - reference time pointtrue if this interval is after given time point else falsepublic boolean isBefore(PlainDate temporal)
ChronoIntervalIs this interval before the given time point?
isBefore in interface ChronoInterval<PlainDate>temporal - reference time pointtrue if this interval is before given time point else falsepublic int length()
Ermittelt die Anzahl der Tage, die zu diesem Kalenderquartal gehören.
public static CalendarQuarter from(GregorianDate date)
Converts given gregorian date to a quarter year.
date - gregorian calendar date (for example PlainDateIllegalArgumentException - if given date is invalidpublic CalendarQuarter plus(Years<CalendarUnit> years)
Adds given years to this quarter year.
years - the count of years to be addedpublic CalendarQuarter plus(Quarters quarters)
Adds given quarter years to this quarter year.
quarters - the count of quarter years to be addedpublic CalendarQuarter minus(Years<CalendarUnit> years)
Subtracts given years from this quarter year.
years - the count of years to be subtractedpublic CalendarQuarter minus(Quarters quarters)
Subtracts given quarter years from this quarter year.
quarters - the count of quarter years to be subtractedpublic int compareTo(CalendarQuarter other)
compareTo in interface Comparable<CalendarQuarter>public Iterator<PlainDate> iterator()
Iterates over all days of this calendar quarter year.
public String toString()
Outputs this instance as a String in CLDR-format "uuuu-'Q'Q" (like "2016-Q1").
public static Chronology<CalendarQuarter> chronology()
Yields the associated chronology.
Copyright © 2014–2018. All rights reserved.