public enum Quarter extends Enum<Quarter>
| Modifier and Type | Method and Description |
|---|---|
Month |
firstMonth()
该季度的第一个月
|
static Quarter |
fromMonth(int monthValue)
根据给定的月份值返回对应的季度
|
static Quarter |
fromMonth(Month month)
根据给定的月份返回对应的季度
|
int |
getValue()
获取季度值
|
Month |
lastMonth()
该季度最后一个月
|
static Quarter |
of(int intValue)
将 季度int转换为Season枚举对象
|
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 Month firstMonth()
public Month lastMonth()
Copyright © 2025. All rights reserved.