equal
deleted
inserted
replaced
79 import java.io.IOException; |
79 import java.io.IOException; |
80 import java.io.InvalidObjectException; |
80 import java.io.InvalidObjectException; |
81 import java.io.ObjectInputStream; |
81 import java.io.ObjectInputStream; |
82 import java.io.Serializable; |
82 import java.io.Serializable; |
83 import java.time.chrono.ChronoLocalDate; |
83 import java.time.chrono.ChronoLocalDate; |
84 import java.time.chrono.Era; |
84 import java.time.chrono.IsoEra; |
85 import java.time.chrono.IsoChronology; |
85 import java.time.chrono.IsoChronology; |
86 import java.time.format.DateTimeFormatter; |
86 import java.time.format.DateTimeFormatter; |
87 import java.time.format.DateTimeParseException; |
87 import java.time.format.DateTimeParseException; |
88 import java.time.temporal.ChronoField; |
88 import java.time.temporal.ChronoField; |
89 import java.time.temporal.ChronoUnit; |
89 import java.time.temporal.ChronoUnit; |
730 * eras, often referred to using 'BC' and 'AD'. |
730 * eras, often referred to using 'BC' and 'AD'. |
731 * <p> |
731 * <p> |
732 * Users of this class should typically ignore this method as it exists primarily |
732 * Users of this class should typically ignore this method as it exists primarily |
733 * to fulfill the {@link ChronoLocalDate} contract where it is necessary to support |
733 * to fulfill the {@link ChronoLocalDate} contract where it is necessary to support |
734 * the Japanese calendar system. |
734 * the Japanese calendar system. |
735 * <p> |
735 * |
736 * The returned era will be a singleton capable of being compared with the constants |
736 * @return the IsoEra applicable at this date, not null |
737 * in {@link IsoChronology} using the {@code ==} operator. |
|
738 * |
|
739 * @return the {@code IsoChronology} era constant applicable at this date, not null |
|
740 */ |
737 */ |
741 @Override // override for Javadoc |
738 @Override // override for Javadoc |
742 public Era getEra() { |
739 public IsoEra getEra() { |
743 return ChronoLocalDate.super.getEra(); |
740 return (getYear() >= 1 ? IsoEra.CE : IsoEra.BCE); |
744 } |
741 } |
745 |
742 |
746 /** |
743 /** |
747 * Gets the year field. |
744 * Gets the year field. |
748 * <p> |
745 * <p> |