public enum Quarter extends Enum<Quarter>
Modifier and Type | Method and Description |
---|---|
YearQuarter |
atYear(int year)
根据指定的年份,获取一个新的 YearQuarter 实例
此方法允许在保持当前季度信息不变的情况下,更改年份
|
static int |
checkValidIntValue(int value)
检查季度的值。
|
Month |
firstMonth()
该季度的第一个月
|
MonthDay |
firstMonthDay()
该季度的第一天
|
int |
firstMonthValue()
该季度的第一个月
|
static Quarter |
fromMonth(int monthValue)
根据给定的月份值返回对应的季度
|
static Quarter |
fromMonth(Month month)
根据给定的月份返回对应的季度
|
int |
getValue()
获取季度值
|
Month |
lastMonth()
该季度最后一个月
|
MonthDay |
lastMonthDay()
该季度的最后一天
|
int |
lastMonthValue()
该季度最后一个月
|
static Quarter |
of(int intValue)
将 季度int转换为Season枚举对象
|
Quarter |
plus(int quarters)
加上指定数量的季度
|
static Quarter |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Quarter[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Quarter Q1
public static final Quarter Q2
public static final Quarter Q3
public static final Quarter Q4
public static Quarter[] values()
for (Quarter c : Quarter.values()) System.out.println(c);
public static Quarter valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getValue()
public static Quarter of(int intValue)
public static Quarter fromMonth(int monthValue)
monthValue
- 月份值,取值范围为1到12IllegalArgumentException
- 如果月份值不在有效范围内(1到12),将抛出异常public static Quarter fromMonth(Month month)
month
- 月份public final YearQuarter atYear(int year)
year
- 指定的年份public Quarter plus(int quarters)
quarters
- 所添加的季度数量public Month firstMonth()
public int firstMonthValue()
public Month lastMonth()
public int lastMonthValue()
public MonthDay firstMonthDay()
public MonthDay lastMonthDay()
public static int checkValidIntValue(int value)
value
- 季度值Copyright © 2025. All rights reserved.