public enum IsoEra extends Enum<IsoEra> implements Era
ISO-8601标准没有定义的时代。一个定义也因此有了两个时代'时代'(CE)多年来在0001-01-01(ISO),和“前时代”(BCE)前多年。
year-of-era | era | proleptic-year |
---|---|---|
2 | CE | 2 |
1 | CE | 1 |
1 | BCE | 0 |
2 | BCE | -1 |
不要使用ordinal()
获得IsoEra
数字表示使用getValue()
代替。
Enum Constant and Description |
---|
BCE
在当前时代之前的一个例子,“前一个时代”,它有数字值0。
|
CE
当前时代的单例实例,“当前时代”,它具有数字值1。
|
Modifier and Type | Method and Description |
---|---|
int |
getValue()
获取数字时代
int 价值。
|
static IsoEra |
of(int isoEra)
获得
IsoEra 实例从一个
int 价值。
|
static IsoEra |
valueOf(String name)
返回此类型具有指定名称的枚举常量。
|
static IsoEra[] |
values()
返回一个数组包含该枚举类型的常量,它们的顺序声明。
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
adjustInto, get, getDisplayName, getLong, isSupported, query, range
public static final IsoEra BCE
public static final IsoEra CE
public static IsoEra[] values()
对于(isoera C:isoera。values()) 系统,println(C);
public static IsoEra valueOf(String name)
name
-定要返回的枚举的名称。
IllegalArgumentException
-如果这个枚举类型,也没有固定的具有指定名称
NullPointerException
-如果参数为空
public static IsoEra of(int isoEra)
IsoEra
实例从一个
int
价值。
IsoEra
代表BCE / CE ISO时代枚举。本厂允许枚举是从int
值。
isoEra
-代表公元前/ CE值,从0(BCE)1(CE)
DateTimeException
-如果值是无效的
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.