|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<ThaiBuddhistEra>
org.threeten.bp.chrono.ThaiBuddhistEra
public enum ThaiBuddhistEra
An era in the Thai Buddhist calendar system.
The Thai Buddhist calendar system has two eras.
Do not use ordinal() to obtain the numeric representation of a ThaiBuddhistEra instance. Use getValue() instead.
| Enum Constant Summary | |
|---|---|
BE
The singleton instance for the current era, 'Buddhist Era', which has the value 1. |
|
BEFORE_BE
The singleton instance for the era before the current one, 'Before Buddhist Era', which has the value 0. |
|
| Method Summary | ||
|---|---|---|
Temporal |
adjustInto(Temporal temporal)
Adjusts the specified temporal object. |
|
int |
get(TemporalField field)
Gets the value of the specified field as an int. |
|
String |
getDisplayName(TextStyle style,
Locale locale)
Gets the textual representation of this era. |
|
long |
getLong(TemporalField field)
Gets the value of the specified field as a long. |
|
int |
getValue()
Gets the era numeric value. |
|
boolean |
isSupported(TemporalField field)
Checks if the specified field is supported. |
|
static ThaiBuddhistEra |
of(int thaiBuddhistEra)
Obtains an instance of ThaiBuddhistEra from a value. |
|
|
query(TemporalQuery<R> query)
Queries this date-time. |
|
ValueRange |
range(TemporalField field)
Gets the range of valid values for the specified field. |
|
static ThaiBuddhistEra |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
|
static ThaiBuddhistEra[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
|
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final ThaiBuddhistEra BEFORE_BE
public static final ThaiBuddhistEra BE
| Method Detail |
|---|
public static ThaiBuddhistEra[] values()
for (ThaiBuddhistEra c : ThaiBuddhistEra.values()) System.out.println(c);
public static ThaiBuddhistEra valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is nullpublic static ThaiBuddhistEra of(int thaiBuddhistEra)
ThaiBuddhistEra from a value.
The current era (from ISO year -543 onwards) has the value 1 The previous era has the value 0.
thaiBuddhistEra - the era to represent, from 0 to 1
IllegalCalendarFieldValueException - if the era is invalidpublic int getValue()
The current era (from ISO year -543 onwards) has the value 1 The previous era has the value 0.
getValue in interface Erapublic boolean isSupported(TemporalField field)
TemporalAccessor
This checks if the date-time can be queried for the specified field.
If false, then calling the range and get
methods will throw an exception.
ChronoField.
If the field is supported, then true is returned, otherwise false
If the field is not a ChronoField, then the result of this method
is obtained by invoking TemporalField.isSupportedBy(TemporalAccessor)
passing this as the argument.
Implementations must not alter this object.
isSupported in interface TemporalAccessorfield - the field to check, null returns false
public ValueRange range(TemporalField field)
TemporalAccessor
All fields can be expressed as a long integer.
This method returns an object that describes the valid range for that value.
The value of this temporal object is used to enhance the accuracy of the returned range.
If the date-time cannot return the range, because the field is unsupported or for
some other reason, an exception will be thrown.
Note that the result only describes the minimum and maximum valid values and it is important not to read too much into them. For example, there could be values within the range that are invalid for the field.
ChronoField.
If the field is supported, then the range of the field must be returned.
If unsupported, then a DateTimeException must be thrown.
If the field is not a ChronoField, then the result of this method
is obtained by invoking TemporalField.rangeRefinedBy(TemporalAccessorl)
passing this as the argument.
Implementations must not alter either this object.
range in interface TemporalAccessorfield - the field to query the range for, not null
public int get(TemporalField field)
TemporalAccessorint.
This queries the date-time for the value for the specified field. The returned value will always be within the valid range of values for the field. If the date-time cannot return the value, because the field is unsupported or for some other reason, an exception will be thrown.
ChronoField.
If the field is supported and has an int range, then the value of
the field must be returned.
If unsupported, then a DateTimeException must be thrown.
If the field is not a ChronoField, then the result of this method
is obtained by invoking TemporalField.getFrom(TemporalAccessor)
passing this as the argument.
Implementations must not alter either this object.
get in interface TemporalAccessorfield - the field to get, not null
public long getLong(TemporalField field)
TemporalAccessorlong.
This queries the date-time for the value for the specified field. The returned value may be outside the valid range of values for the field. If the date-time cannot return the value, because the field is unsupported or for some other reason, an exception will be thrown.
ChronoField.
If the field is supported, then the value of the field must be returned.
If unsupported, then a DateTimeException must be thrown.
If the field is not a ChronoField, then the result of this method
is obtained by invoking TemporalField.getFrom(TemporalAccessor)
passing this as the argument.
Implementations must not alter either this object.
getLong in interface TemporalAccessorfield - the field to get, not null
public Temporal adjustInto(Temporal temporal)
TemporalAdjusterThis adjusts the specified temporal object using the logic encapsulated in the implementing class. Examples might be an adjuster that sets the date avoiding weekends, or one that sets the date to the last day of the month.
There are two equivalent ways of using this method.
The first is to invoke this method directly.
The second is to use Temporal.with(TemporalAdjuster):
// these two lines are equivalent, but the second approach is recommended temporal = thisAdjuster.adjustInto(temporal); temporal = temporal.with(thisAdjuster);It is recommended to use the second approach,
with(TemporalAdjuster),
as it is a lot clearer to read in code.
Temporal to
query the temporal object and perform the adjustment.
The returned object must have the same observable type as the input object
The input object must not be altered. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable temporal objects.
The input temporal object may be in a calendar system other than ISO.
Implementations may choose to document compatibility with other calendar systems,
or reject non-ISO temporal objects by querying the chronology.
This method may be called from multiple threads in parallel. It must be thread-safe when invoked.
adjustInto in interface TemporalAdjustertemporal - the temporal object to adjust, not null
public <R> R query(TemporalQuery<R> query)
TemporalAccessorThis queries this date-time using the specified query strategy object.
Queries are a key tool for extracting information from date-times. They exists to externalize the process of querying, permitting different approaches, as per the strategy design pattern. Examples might be a query that checks if the date is the day before February 29th in a leap year, or calculates the number of days to your next birthday.
The most common query implementations are method references, such as
LocalDate::from and ZoneId::from.
Further implementations are on TemporalQueries.
Queries may also be defined by applications.
public <R> R query(TemporalQuery<R> type) {
// only include an if statement if the implementation can return it
if (query == TemporalQueries.zoneId()) return // the ZoneId
if (query == TemporalQueries.chronology()) return // the Chrono
if (query == TemporalQueries.precision()) return // the precision
// call default method
return super.query(query);
}
query in interface TemporalAccessorR - the type of the resultquery - the query to invoke, not null
public String getDisplayName(TextStyle style,
Locale locale)
EraThis returns the textual name used to identify the era. The parameters control the style of the returned text and the locale.
If no textual mapping is found then the numeric value is returned.
getDisplayName in interface Erastyle - the style of the text required, not nulllocale - the locale to use, not null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||