476 lines
24 KiB
Java
476 lines
24 KiB
Java
package o;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.Arrays;
|
|
import java.util.Calendar;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Locale;
|
|
import java.util.Map;
|
|
import org.threeten.bp.DateTimeException;
|
|
|
|
/* renamed from: o.gtf, reason: case insensitive filesystem */
|
|
/* loaded from: classes6.dex */
|
|
public final class C15545gtf extends gsR implements Serializable {
|
|
private static final Map<String, String[]> ERA_FULL_NAMES;
|
|
private static final Map<String, String[]> ERA_NARROW_NAMES;
|
|
private static final Map<String, String[]> ERA_SHORT_NAMES;
|
|
private static final String FALLBACK_LANGUAGE = "en";
|
|
private static final long serialVersionUID = 459996390165777884L;
|
|
private static final String TARGET_LANGUAGE = "ja";
|
|
static final Locale LOCALE = new Locale(TARGET_LANGUAGE, "JP", "JP");
|
|
public static final C15545gtf INSTANCE = new C15545gtf();
|
|
|
|
@Override // o.gsR
|
|
public final /* bridge */ /* synthetic */ gsJ resolveDate(Map map, gtA gta) {
|
|
return resolveDate((Map<InterfaceC15537gtP, Long>) map, gta);
|
|
}
|
|
|
|
static {
|
|
HashMap hashMap = new HashMap();
|
|
ERA_NARROW_NAMES = hashMap;
|
|
HashMap hashMap2 = new HashMap();
|
|
ERA_SHORT_NAMES = hashMap2;
|
|
HashMap hashMap3 = new HashMap();
|
|
ERA_FULL_NAMES = hashMap3;
|
|
hashMap.put(FALLBACK_LANGUAGE, new String[]{"Unknown", "K", "M", "T", "S", "H"});
|
|
hashMap.put(TARGET_LANGUAGE, new String[]{"Unknown", "K", "M", "T", "S", "H"});
|
|
hashMap2.put(FALLBACK_LANGUAGE, new String[]{"Unknown", "K", "M", "T", "S", "H"});
|
|
hashMap2.put(TARGET_LANGUAGE, new String[]{"Unknown", "慶", "明", "大", "昭", "平"});
|
|
hashMap3.put(FALLBACK_LANGUAGE, new String[]{"Unknown", "Keio", "Meiji", "Taisho", "Showa", "Heisei"});
|
|
hashMap3.put(TARGET_LANGUAGE, new String[]{"Unknown", "慶応", "明治", "大正", "昭和", "平成"});
|
|
}
|
|
|
|
private C15545gtf() {
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final C15543gtd date(gsY gsy, int i, int i2, int i3) {
|
|
if (!(gsy instanceof C15542gtc)) {
|
|
throw new ClassCastException("Era must be JapaneseEra");
|
|
}
|
|
return C15543gtd.of((C15542gtc) gsy, i, i2, i3);
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final C15543gtd date(int i, int i2, int i3) {
|
|
return new C15543gtd(C15520gsp.of(i, i2, i3));
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final C15543gtd dateYearDay(gsY gsy, int i, int i2) {
|
|
if (!(gsy instanceof C15542gtc)) {
|
|
throw new ClassCastException("Era must be JapaneseEra");
|
|
}
|
|
return C15543gtd.ofYearDay((C15542gtc) gsy, i, i2);
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final C15543gtd dateYearDay(int i, int i2) {
|
|
C15520gsp ofYearDay = C15520gsp.ofYearDay(i, i2);
|
|
return date(i, ofYearDay.getMonthValue(), ofYearDay.getDayOfMonth());
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final C15543gtd dateEpochDay(long j) {
|
|
return new C15543gtd(C15520gsp.ofEpochDay(j));
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final C15543gtd date(gtK gtk) {
|
|
if (gtk instanceof C15543gtd) {
|
|
return (C15543gtd) gtk;
|
|
}
|
|
return new C15543gtd(C15520gsp.from(gtk));
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final gsO<C15543gtd> localDateTime(gtK gtk) {
|
|
return super.localDateTime(gtk);
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final gsS<C15543gtd> zonedDateTime(gtK gtk) {
|
|
return super.zonedDateTime(gtk);
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final gsS<C15543gtd> zonedDateTime(C15523gss c15523gss, AbstractC15502gsH abstractC15502gsH) {
|
|
return super.zonedDateTime(c15523gss, abstractC15502gsH);
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final C15543gtd dateNow() {
|
|
return (C15543gtd) super.dateNow();
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final C15543gtd dateNow(AbstractC15502gsH abstractC15502gsH) {
|
|
return (C15543gtd) super.dateNow(abstractC15502gsH);
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final C15543gtd dateNow(AbstractC15514gsj abstractC15514gsj) {
|
|
gtG.requireNonNull(abstractC15514gsj, "clock");
|
|
return (C15543gtd) super.dateNow(abstractC15514gsj);
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final boolean isLeapYear(long j) {
|
|
return gsV.INSTANCE.isLeapYear(j);
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final int prolepticYear(gsY gsy, int i) {
|
|
if (!(gsy instanceof C15542gtc)) {
|
|
throw new ClassCastException("Era must be JapaneseEra");
|
|
}
|
|
int year = ((C15542gtc) gsy).startDate().getYear();
|
|
gtT.of(1L, (r6.endDate().getYear() - r6.startDate().getYear()) + 1).checkValidValue(i, EnumC15534gtD.YEAR_OF_ERA);
|
|
return (year + i) - 1;
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final C15542gtc eraOf(int i) {
|
|
return C15542gtc.of(i);
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final List<gsY> eras() {
|
|
return Arrays.asList(C15542gtc.values());
|
|
}
|
|
|
|
/* renamed from: o.gtf$1, reason: invalid class name */
|
|
/* loaded from: classes6.dex */
|
|
static /* synthetic */ class AnonymousClass1 {
|
|
static final int[] $SwitchMap$org$threeten$bp$temporal$ChronoField;
|
|
|
|
static {
|
|
int[] iArr = new int[EnumC15534gtD.values().length];
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField = iArr;
|
|
try {
|
|
iArr[EnumC15534gtD.DAY_OF_MONTH.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.DAY_OF_WEEK.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.MICRO_OF_DAY.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.MICRO_OF_SECOND.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.HOUR_OF_DAY.ordinal()] = 5;
|
|
} catch (NoSuchFieldError unused5) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.HOUR_OF_AMPM.ordinal()] = 6;
|
|
} catch (NoSuchFieldError unused6) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.MINUTE_OF_DAY.ordinal()] = 7;
|
|
} catch (NoSuchFieldError unused7) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.MINUTE_OF_HOUR.ordinal()] = 8;
|
|
} catch (NoSuchFieldError unused8) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.SECOND_OF_DAY.ordinal()] = 9;
|
|
} catch (NoSuchFieldError unused9) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.SECOND_OF_MINUTE.ordinal()] = 10;
|
|
} catch (NoSuchFieldError unused10) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.MILLI_OF_DAY.ordinal()] = 11;
|
|
} catch (NoSuchFieldError unused11) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.MILLI_OF_SECOND.ordinal()] = 12;
|
|
} catch (NoSuchFieldError unused12) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.NANO_OF_DAY.ordinal()] = 13;
|
|
} catch (NoSuchFieldError unused13) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.NANO_OF_SECOND.ordinal()] = 14;
|
|
} catch (NoSuchFieldError unused14) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.CLOCK_HOUR_OF_DAY.ordinal()] = 15;
|
|
} catch (NoSuchFieldError unused15) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.CLOCK_HOUR_OF_AMPM.ordinal()] = 16;
|
|
} catch (NoSuchFieldError unused16) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.EPOCH_DAY.ordinal()] = 17;
|
|
} catch (NoSuchFieldError unused17) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.PROLEPTIC_MONTH.ordinal()] = 18;
|
|
} catch (NoSuchFieldError unused18) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.ERA.ordinal()] = 19;
|
|
} catch (NoSuchFieldError unused19) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.YEAR.ordinal()] = 20;
|
|
} catch (NoSuchFieldError unused20) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.YEAR_OF_ERA.ordinal()] = 21;
|
|
} catch (NoSuchFieldError unused21) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.MONTH_OF_YEAR.ordinal()] = 22;
|
|
} catch (NoSuchFieldError unused22) {
|
|
}
|
|
try {
|
|
$SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.DAY_OF_YEAR.ordinal()] = 23;
|
|
} catch (NoSuchFieldError unused23) {
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final gtT range(EnumC15534gtD enumC15534gtD) {
|
|
switch (AnonymousClass1.$SwitchMap$org$threeten$bp$temporal$ChronoField[enumC15534gtD.ordinal()]) {
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 5:
|
|
case 6:
|
|
case 7:
|
|
case 8:
|
|
case 9:
|
|
case 10:
|
|
case 11:
|
|
case 12:
|
|
case 13:
|
|
case 14:
|
|
case 15:
|
|
case 16:
|
|
case 17:
|
|
case 18:
|
|
return enumC15534gtD.range();
|
|
default:
|
|
Calendar calendar = Calendar.getInstance(LOCALE);
|
|
int i = 0;
|
|
switch (AnonymousClass1.$SwitchMap$org$threeten$bp$temporal$ChronoField[enumC15534gtD.ordinal()]) {
|
|
case 19:
|
|
C15542gtc[] values = C15542gtc.values();
|
|
return gtT.of(values[0].getValue(), values[values.length - 1].getValue());
|
|
case 20:
|
|
C15542gtc[] values2 = C15542gtc.values();
|
|
return gtT.of(C15543gtd.MIN_DATE.getYear(), values2[values2.length - 1].endDate().getYear());
|
|
case 21:
|
|
C15542gtc[] values3 = C15542gtc.values();
|
|
int year = values3[values3.length - 1].endDate().getYear();
|
|
int year2 = values3[values3.length - 1].startDate().getYear();
|
|
int i2 = Integer.MAX_VALUE;
|
|
while (i < values3.length) {
|
|
i2 = Math.min(i2, (values3[i].endDate().getYear() - values3[i].startDate().getYear()) + 1);
|
|
i++;
|
|
}
|
|
return gtT.of(1L, 6L, i2, (year - year2) + 1);
|
|
case 22:
|
|
return gtT.of(calendar.getMinimum(2) + 1, calendar.getGreatestMinimum(2) + 1, calendar.getLeastMaximum(2) + 1, calendar.getMaximum(2) + 1);
|
|
case 23:
|
|
C15542gtc[] values4 = C15542gtc.values();
|
|
int i3 = 366;
|
|
while (i < values4.length) {
|
|
i3 = Math.min(i3, (values4[i].startDate().lengthOfYear() - values4[i].startDate().getDayOfYear()) + 1);
|
|
i++;
|
|
}
|
|
return gtT.of(1L, i3, 366L);
|
|
default:
|
|
throw new UnsupportedOperationException("Unimplementable field: ".concat(String.valueOf(enumC15534gtD)));
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Type inference failed for: r9v17, types: [o.gtd, o.gtE] */
|
|
/* JADX WARN: Type inference failed for: r9v32, types: [o.gtd] */
|
|
/* JADX WARN: Type inference failed for: r9v68, types: [o.gtd] */
|
|
@Override // o.gsR
|
|
public final C15543gtd resolveDate(Map<InterfaceC15537gtP, Long> map, gtA gta) {
|
|
if (map.containsKey(EnumC15534gtD.EPOCH_DAY)) {
|
|
return dateEpochDay(map.remove(EnumC15534gtD.EPOCH_DAY).longValue());
|
|
}
|
|
Long remove = map.remove(EnumC15534gtD.PROLEPTIC_MONTH);
|
|
if (remove != null) {
|
|
if (gta != gtA.LENIENT) {
|
|
EnumC15534gtD.PROLEPTIC_MONTH.checkValidValue(remove.longValue());
|
|
}
|
|
updateResolveMap(map, EnumC15534gtD.MONTH_OF_YEAR, gtG.floorMod(remove.longValue(), 12) + 1);
|
|
updateResolveMap(map, EnumC15534gtD.YEAR, gtG.floorDiv(remove.longValue(), 12L));
|
|
}
|
|
Long l = map.get(EnumC15534gtD.ERA);
|
|
C15542gtc eraOf = l != null ? eraOf(range(EnumC15534gtD.ERA).checkValidIntValue(l.longValue(), EnumC15534gtD.ERA)) : null;
|
|
Long l2 = map.get(EnumC15534gtD.YEAR_OF_ERA);
|
|
if (l2 != null) {
|
|
int checkValidIntValue = range(EnumC15534gtD.YEAR_OF_ERA).checkValidIntValue(l2.longValue(), EnumC15534gtD.YEAR_OF_ERA);
|
|
if (eraOf == null && gta != gtA.STRICT && !map.containsKey(EnumC15534gtD.YEAR)) {
|
|
List<gsY> eras = eras();
|
|
eraOf = (C15542gtc) eras.get(eras.size() - 1);
|
|
}
|
|
if (eraOf != null && map.containsKey(EnumC15534gtD.MONTH_OF_YEAR) && map.containsKey(EnumC15534gtD.DAY_OF_MONTH)) {
|
|
map.remove(EnumC15534gtD.ERA);
|
|
map.remove(EnumC15534gtD.YEAR_OF_ERA);
|
|
return resolveEYMD(map, gta, eraOf, checkValidIntValue);
|
|
}
|
|
if (eraOf != null && map.containsKey(EnumC15534gtD.DAY_OF_YEAR)) {
|
|
map.remove(EnumC15534gtD.ERA);
|
|
map.remove(EnumC15534gtD.YEAR_OF_ERA);
|
|
return resolveEYD(map, gta, eraOf, checkValidIntValue);
|
|
}
|
|
}
|
|
if (map.containsKey(EnumC15534gtD.YEAR)) {
|
|
if (map.containsKey(EnumC15534gtD.MONTH_OF_YEAR)) {
|
|
if (map.containsKey(EnumC15534gtD.DAY_OF_MONTH)) {
|
|
int checkValidIntValue2 = EnumC15534gtD.YEAR.checkValidIntValue(map.remove(EnumC15534gtD.YEAR).longValue());
|
|
if (gta == gtA.LENIENT) {
|
|
return date(checkValidIntValue2, 1, 1).plusMonths(gtG.safeSubtract(map.remove(EnumC15534gtD.MONTH_OF_YEAR).longValue(), 1L)).plusDays(gtG.safeSubtract(map.remove(EnumC15534gtD.DAY_OF_MONTH).longValue(), 1L));
|
|
}
|
|
int checkValidIntValue3 = range(EnumC15534gtD.MONTH_OF_YEAR).checkValidIntValue(map.remove(EnumC15534gtD.MONTH_OF_YEAR).longValue(), EnumC15534gtD.MONTH_OF_YEAR);
|
|
int checkValidIntValue4 = range(EnumC15534gtD.DAY_OF_MONTH).checkValidIntValue(map.remove(EnumC15534gtD.DAY_OF_MONTH).longValue(), EnumC15534gtD.DAY_OF_MONTH);
|
|
if (gta == gtA.SMART && checkValidIntValue4 > 28) {
|
|
checkValidIntValue4 = Math.min(checkValidIntValue4, date(checkValidIntValue2, checkValidIntValue3, 1).lengthOfMonth());
|
|
}
|
|
return date(checkValidIntValue2, checkValidIntValue3, checkValidIntValue4);
|
|
}
|
|
if (map.containsKey(EnumC15534gtD.ALIGNED_WEEK_OF_MONTH)) {
|
|
if (map.containsKey(EnumC15534gtD.ALIGNED_DAY_OF_WEEK_IN_MONTH)) {
|
|
int checkValidIntValue5 = EnumC15534gtD.YEAR.checkValidIntValue(map.remove(EnumC15534gtD.YEAR).longValue());
|
|
if (gta == gtA.LENIENT) {
|
|
return date(checkValidIntValue5, 1, 1).plus(gtG.safeSubtract(map.remove(EnumC15534gtD.MONTH_OF_YEAR).longValue(), 1L), (InterfaceC15539gtV) gtH.MONTHS).plus(gtG.safeSubtract(map.remove(EnumC15534gtD.ALIGNED_WEEK_OF_MONTH).longValue(), 1L), (InterfaceC15539gtV) gtH.WEEKS).plus(gtG.safeSubtract(map.remove(EnumC15534gtD.ALIGNED_DAY_OF_WEEK_IN_MONTH).longValue(), 1L), (InterfaceC15539gtV) gtH.DAYS);
|
|
}
|
|
int checkValidIntValue6 = EnumC15534gtD.MONTH_OF_YEAR.checkValidIntValue(map.remove(EnumC15534gtD.MONTH_OF_YEAR).longValue());
|
|
C15543gtd plus = date(checkValidIntValue5, checkValidIntValue6, 1).plus(((EnumC15534gtD.ALIGNED_WEEK_OF_MONTH.checkValidIntValue(map.remove(EnumC15534gtD.ALIGNED_WEEK_OF_MONTH).longValue()) - 1) * 7) + (EnumC15534gtD.ALIGNED_DAY_OF_WEEK_IN_MONTH.checkValidIntValue(map.remove(EnumC15534gtD.ALIGNED_DAY_OF_WEEK_IN_MONTH).longValue()) - 1), (InterfaceC15539gtV) gtH.DAYS);
|
|
if (gta != gtA.STRICT || plus.get(EnumC15534gtD.MONTH_OF_YEAR) == checkValidIntValue6) {
|
|
return plus;
|
|
}
|
|
throw new DateTimeException("Strict mode rejected date parsed to a different month");
|
|
}
|
|
if (map.containsKey(EnumC15534gtD.DAY_OF_WEEK)) {
|
|
int checkValidIntValue7 = EnumC15534gtD.YEAR.checkValidIntValue(map.remove(EnumC15534gtD.YEAR).longValue());
|
|
if (gta == gtA.LENIENT) {
|
|
return date(checkValidIntValue7, 1, 1).plus(gtG.safeSubtract(map.remove(EnumC15534gtD.MONTH_OF_YEAR).longValue(), 1L), (InterfaceC15539gtV) gtH.MONTHS).plus(gtG.safeSubtract(map.remove(EnumC15534gtD.ALIGNED_WEEK_OF_MONTH).longValue(), 1L), (InterfaceC15539gtV) gtH.WEEKS).plus(gtG.safeSubtract(map.remove(EnumC15534gtD.DAY_OF_WEEK).longValue(), 1L), (InterfaceC15539gtV) gtH.DAYS);
|
|
}
|
|
int checkValidIntValue8 = EnumC15534gtD.MONTH_OF_YEAR.checkValidIntValue(map.remove(EnumC15534gtD.MONTH_OF_YEAR).longValue());
|
|
C15543gtd with = date(checkValidIntValue7, checkValidIntValue8, 1).plus(EnumC15534gtD.ALIGNED_WEEK_OF_MONTH.checkValidIntValue(map.remove(EnumC15534gtD.ALIGNED_WEEK_OF_MONTH).longValue()) - 1, (InterfaceC15539gtV) gtH.WEEKS).with(gtO.nextOrSame(EnumC15515gsk.of(EnumC15534gtD.DAY_OF_WEEK.checkValidIntValue(map.remove(EnumC15534gtD.DAY_OF_WEEK).longValue()))));
|
|
if (gta != gtA.STRICT || with.get(EnumC15534gtD.MONTH_OF_YEAR) == checkValidIntValue8) {
|
|
return with;
|
|
}
|
|
throw new DateTimeException("Strict mode rejected date parsed to a different month");
|
|
}
|
|
}
|
|
}
|
|
if (map.containsKey(EnumC15534gtD.DAY_OF_YEAR)) {
|
|
int checkValidIntValue9 = EnumC15534gtD.YEAR.checkValidIntValue(map.remove(EnumC15534gtD.YEAR).longValue());
|
|
if (gta == gtA.LENIENT) {
|
|
return dateYearDay(checkValidIntValue9, 1).plusDays(gtG.safeSubtract(map.remove(EnumC15534gtD.DAY_OF_YEAR).longValue(), 1L));
|
|
}
|
|
return dateYearDay(checkValidIntValue9, EnumC15534gtD.DAY_OF_YEAR.checkValidIntValue(map.remove(EnumC15534gtD.DAY_OF_YEAR).longValue()));
|
|
}
|
|
if (map.containsKey(EnumC15534gtD.ALIGNED_WEEK_OF_YEAR)) {
|
|
if (map.containsKey(EnumC15534gtD.ALIGNED_DAY_OF_WEEK_IN_YEAR)) {
|
|
int checkValidIntValue10 = EnumC15534gtD.YEAR.checkValidIntValue(map.remove(EnumC15534gtD.YEAR).longValue());
|
|
if (gta == gtA.LENIENT) {
|
|
return date(checkValidIntValue10, 1, 1).plus(gtG.safeSubtract(map.remove(EnumC15534gtD.ALIGNED_WEEK_OF_YEAR).longValue(), 1L), (InterfaceC15539gtV) gtH.WEEKS).plus(gtG.safeSubtract(map.remove(EnumC15534gtD.ALIGNED_DAY_OF_WEEK_IN_YEAR).longValue(), 1L), (InterfaceC15539gtV) gtH.DAYS);
|
|
}
|
|
?? plusDays = date(checkValidIntValue10, 1, 1).plusDays(((EnumC15534gtD.ALIGNED_WEEK_OF_YEAR.checkValidIntValue(map.remove(EnumC15534gtD.ALIGNED_WEEK_OF_YEAR).longValue()) - 1) * 7) + (EnumC15534gtD.ALIGNED_DAY_OF_WEEK_IN_YEAR.checkValidIntValue(map.remove(EnumC15534gtD.ALIGNED_DAY_OF_WEEK_IN_YEAR).longValue()) - 1));
|
|
if (gta != gtA.STRICT || plusDays.get(EnumC15534gtD.YEAR) == checkValidIntValue10) {
|
|
return plusDays;
|
|
}
|
|
throw new DateTimeException("Strict mode rejected date parsed to a different year");
|
|
}
|
|
if (map.containsKey(EnumC15534gtD.DAY_OF_WEEK)) {
|
|
int checkValidIntValue11 = EnumC15534gtD.YEAR.checkValidIntValue(map.remove(EnumC15534gtD.YEAR).longValue());
|
|
if (gta == gtA.LENIENT) {
|
|
return date(checkValidIntValue11, 1, 1).plus(gtG.safeSubtract(map.remove(EnumC15534gtD.ALIGNED_WEEK_OF_YEAR).longValue(), 1L), (InterfaceC15539gtV) gtH.WEEKS).plus(gtG.safeSubtract(map.remove(EnumC15534gtD.DAY_OF_WEEK).longValue(), 1L), (InterfaceC15539gtV) gtH.DAYS);
|
|
}
|
|
C15543gtd with2 = date(checkValidIntValue11, 1, 1).plus(EnumC15534gtD.ALIGNED_WEEK_OF_YEAR.checkValidIntValue(map.remove(EnumC15534gtD.ALIGNED_WEEK_OF_YEAR).longValue()) - 1, (InterfaceC15539gtV) gtH.WEEKS).with(gtO.nextOrSame(EnumC15515gsk.of(EnumC15534gtD.DAY_OF_WEEK.checkValidIntValue(map.remove(EnumC15534gtD.DAY_OF_WEEK).longValue()))));
|
|
if (gta != gtA.STRICT || with2.get(EnumC15534gtD.YEAR) == checkValidIntValue11) {
|
|
return with2;
|
|
}
|
|
throw new DateTimeException("Strict mode rejected date parsed to a different month");
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private C15543gtd resolveEYMD(Map<InterfaceC15537gtP, Long> map, gtA gta, C15542gtc c15542gtc, int i) {
|
|
if (gta == gtA.LENIENT) {
|
|
int year = c15542gtc.startDate().getYear();
|
|
long safeSubtract = gtG.safeSubtract(map.remove(EnumC15534gtD.MONTH_OF_YEAR).longValue(), 1L);
|
|
return date((year + i) - 1, 1, 1).plus(safeSubtract, (InterfaceC15539gtV) gtH.MONTHS).plus(gtG.safeSubtract(map.remove(EnumC15534gtD.DAY_OF_MONTH).longValue(), 1L), (InterfaceC15539gtV) gtH.DAYS);
|
|
}
|
|
int checkValidIntValue = range(EnumC15534gtD.MONTH_OF_YEAR).checkValidIntValue(map.remove(EnumC15534gtD.MONTH_OF_YEAR).longValue(), EnumC15534gtD.MONTH_OF_YEAR);
|
|
int checkValidIntValue2 = range(EnumC15534gtD.DAY_OF_MONTH).checkValidIntValue(map.remove(EnumC15534gtD.DAY_OF_MONTH).longValue(), EnumC15534gtD.DAY_OF_MONTH);
|
|
if (gta != gtA.SMART) {
|
|
return date((gsY) c15542gtc, i, checkValidIntValue, checkValidIntValue2);
|
|
}
|
|
if (i <= 0) {
|
|
throw new DateTimeException("Invalid YearOfEra: ".concat(String.valueOf(i)));
|
|
}
|
|
int year2 = (c15542gtc.startDate().getYear() + i) - 1;
|
|
if (checkValidIntValue2 > 28) {
|
|
checkValidIntValue2 = Math.min(checkValidIntValue2, date(year2, checkValidIntValue, 1).lengthOfMonth());
|
|
}
|
|
C15543gtd date = date(year2, checkValidIntValue, checkValidIntValue2);
|
|
if (date.getEra() != c15542gtc) {
|
|
if (Math.abs(date.getEra().getValue() - c15542gtc.getValue()) > 1) {
|
|
StringBuilder sb = new StringBuilder("Invalid Era/YearOfEra: ");
|
|
sb.append(c15542gtc);
|
|
sb.append(" ");
|
|
sb.append(i);
|
|
throw new DateTimeException(sb.toString());
|
|
}
|
|
if (date.get(EnumC15534gtD.YEAR_OF_ERA) != 1 && i != 1) {
|
|
StringBuilder sb2 = new StringBuilder("Invalid Era/YearOfEra: ");
|
|
sb2.append(c15542gtc);
|
|
sb2.append(" ");
|
|
sb2.append(i);
|
|
throw new DateTimeException(sb2.toString());
|
|
}
|
|
}
|
|
return date;
|
|
}
|
|
|
|
private C15543gtd resolveEYD(Map<InterfaceC15537gtP, Long> map, gtA gta, C15542gtc c15542gtc, int i) {
|
|
if (gta == gtA.LENIENT) {
|
|
int year = c15542gtc.startDate().getYear();
|
|
return dateYearDay((year + i) - 1, 1).plus(gtG.safeSubtract(map.remove(EnumC15534gtD.DAY_OF_YEAR).longValue(), 1L), (InterfaceC15539gtV) gtH.DAYS);
|
|
}
|
|
return dateYearDay((gsY) c15542gtc, i, range(EnumC15534gtD.DAY_OF_YEAR).checkValidIntValue(map.remove(EnumC15534gtD.DAY_OF_YEAR).longValue(), EnumC15534gtD.DAY_OF_YEAR));
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final String getId() {
|
|
return "Japanese";
|
|
}
|
|
|
|
@Override // o.gsR
|
|
public final String getCalendarType() {
|
|
return "japanese";
|
|
}
|
|
|
|
private Object readResolve() {
|
|
return INSTANCE;
|
|
}
|
|
}
|