public enum IsoEra extends Enum<IsoEra> implements Era
ISO-8601标准没有定义时间。 因此,在此之前多年来,在0001-01-01(ISO)之后或之后已经有两个时代 - “当代”(CE),“当前时代”(BCE)之前的定义。
year-of-era era proleptic-year 2 CE 2 1 CE 1 1 BCE 0 2 BCE -1 不要使用ordinal()获得IsoEra的数字IsoEra 。 改用getValue() 。
| Enum Constant and Description |
|---|
BCE
在当前时代之前的“当前时代之前”的单例实例,其数值为0。
|
CE
当前时代的单身实例“当前时代”,其数值为1。
|
| Modifier and Type | Method and Description |
|---|---|
int |
getValue()
获得数字时代
int价值。
|
static IsoEra |
of(int isoEra)
从
int获得
IsoEra一个实例。
|
static IsoEra |
valueOf(String name)
以指定的名称返回此类型的枚举常量。
|
static IsoEra[] |
values()
按照它们声明的顺序返回一个包含此枚举类型常量的数组。
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfadjustInto, get, getDisplayName, getLong, isSupported, query, rangepublic static final IsoEra BCE
public static final IsoEra CE
public static IsoEra[] values()
for (IsoEra c : IsoEra.values())
System.out.println(c);
public static IsoEra valueOf(String name)
name - 要返回的枚举常量的名称。
IllegalArgumentException - 如果此枚举类型没有指定名称的常量
NullPointerException - 如果参数为空
public static IsoEra of(int isoEra)
int获得IsoEra一个实例。
IsoEra是一个表示BCE / CE的ISO时代的枚举。 该工厂允许从int获取枚举。
isoEra - 从0(BCE)到1(CE)的BCE / 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.