Class/Object

java.time.chrono

MinguoEra

Related Docs: object MinguoEra | package chrono

Permalink

final class MinguoEra extends Enum[MinguoEra] with Era

An era in the Minguo calendar system.

The Minguo calendar system has two eras. The date 0001-01-01 (Minguo) is equal to 1912-01-01 (ISO).

Do not use ordinal() to obtain the numeric representation of MinguoEra. Use getValue() instead.

Specification for implementors

This is an immutable and thread-safe enum.

Linear Supertypes
Era, TemporalAdjuster, TemporalAccessor, Enum[MinguoEra], Serializable, Comparable[MinguoEra], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MinguoEra
  2. Era
  3. TemporalAdjuster
  4. TemporalAccessor
  5. Enum
  6. Serializable
  7. Comparable
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MinguoEra(name: String, ordinal: Int)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def adjustInto(temporal: Temporal): Temporal

    Permalink

    Adjusts the specified temporal object.

    Adjusts the specified temporal object.

    This 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.

    Specification for implementors

    The implementation must take the input object and adjust it. The implementation defines the logic of the adjustment and is responsible for documenting that logic. It may use any method on 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.

    temporal

    the temporal object to adjust, not null

    returns

    an object of the same observable type with the adjustment made, not null

    Definition Classes
    EraTemporalAdjuster
    Exceptions thrown

    ArithmeticException if numeric overflow occurs

    DateTimeException if unable to make the adjustment

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. final def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    Enum → AnyRef
    Annotations
    @throws( ... )
  7. final def compareTo(arg0: MinguoEra): Int

    Permalink
    Definition Classes
    Enum → Comparable
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. final def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    Enum → AnyRef → Any
  10. final def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    Enum → AnyRef
  11. def get(field: TemporalField): Int

    Permalink

    Gets the value of the specified field as an int.

    Gets the value of the specified field as an int.

    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.

    Specification for implementors

    Implementations must check and handle all fields defined in 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.

    field

    the field to get, not null

    returns

    the value for the field, within the valid range of values

    Definition Classes
    EraTemporalAccessor
    Exceptions thrown

    ArithmeticException if numeric overflow occurs

    DateTimeException if the value is outside the range of valid values for the field

  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def getDeclaringClass(): Class[MinguoEra]

    Permalink
    Definition Classes
    Enum
  14. def getDisplayName(style: TextStyle, locale: Locale): String

    Permalink

    Gets the textual representation of this era.

    Gets the textual representation of this era.

    This 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.

    style

    the style of the text required, not null

    locale

    the locale to use, not null

    returns

    the text value of the era, not null

    Definition Classes
    Era
  15. def getLong(field: TemporalField): Long

    Permalink

    Gets the value of the specified field as a long.

    Gets the value of the specified field as a long.

    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.

    Specification for implementors

    Implementations must check and handle all fields defined in 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.

    field

    the field to get, not null

    returns

    the value for the field

    Definition Classes
    EraTemporalAccessor
    Exceptions thrown

    ArithmeticException if numeric overflow occurs

    DateTimeException if a value for the field cannot be obtained

  16. def getValue: Int

    Permalink

    Gets the numeric era int value.

    Gets the numeric era int value.

    The era BEFORE_ROC has the value 0, while the era ROC has the value 1.

    returns

    the era value, from 0 (BEFORE_ROC) to 1 (ROC)

    Definition Classes
    MinguoEraEra
  17. final def hashCode(): Int

    Permalink
    Definition Classes
    Enum → AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. def isSupported(field: TemporalField): Boolean

    Permalink

    Checks if the specified field is supported.

    Checks if the specified field is supported.

    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.

    Specification for implementors

    Implementations must check and handle all fields defined in 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.

    field

    the field to check, null returns false

    returns

    true if this date-time can be queried for the field, false if not

    Definition Classes
    EraTemporalAccessor
  20. final def name(): String

    Permalink
    Definition Classes
    Enum
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def ordinal(): Int

    Permalink
    Definition Classes
    Enum
  25. def query[R](query: TemporalQuery[R]): R

    Permalink

    Queries this date-time.

    Queries this date-time.

    This 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.

    Specification for implementors

    Implementations of this method must behave as follows:

    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);
    }
    

    R

    the type of the result

    query

    the query to invoke, not null

    returns

    the query result, null may be returned (defined by the query)

    Definition Classes
    EraTemporalAccessor
    Exceptions thrown

    ArithmeticException if numeric overflow occurs

    DateTimeException if unable to query

  26. def range(field: TemporalField): ValueRange

    Permalink

    Gets the range of valid values for the specified field.

    Gets the range of valid values for the specified field.

    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.

    Specification for implementors

    Implementations must check and handle all fields defined in 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.

    field

    the field to query the range for, not null

    returns

    the range of valid values for the field, not null

    Definition Classes
    TemporalAccessor
    Exceptions thrown

    DateTimeException if the range for the field cannot be obtained

  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  28. def toString(): String

    Permalink
    Definition Classes
    Enum → AnyRef → Any
  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Era

Inherited from TemporalAdjuster

Inherited from TemporalAccessor

Inherited from Enum[MinguoEra]

Inherited from Serializable

Inherited from Comparable[MinguoEra]

Inherited from AnyRef

Inherited from Any

Ungrouped