public Chronology withZone(DateTimeZone zone) { if (zone == null) { zone = DateTimeZone.getDefault(); } if (zone == DateTimeZone.UTC) { return withUTC(); } if (zone == getZone()) { return this; } return LenientChronology.getInstance(getBase().withZone(zone)); }
/** * Create a LenientChronology for any chronology. * * @param base the chronology to wrap * @throws IllegalArgumentException if chronology is null */ public static LenientChronology getInstance(Chronology base) { if (base == null) { throw new IllegalArgumentException("Must supply a chronology"); } return new LenientChronology(base); }
protected void assemble(Fields fields) { fields.year = convertField(fields.year); fields.yearOfEra = convertField(fields.yearOfEra); fields.yearOfCentury = convertField(fields.yearOfCentury); fields.centuryOfEra = convertField(fields.centuryOfEra); fields.era = convertField(fields.era); fields.dayOfWeek = convertField(fields.dayOfWeek); fields.dayOfMonth = convertField(fields.dayOfMonth); fields.dayOfYear = convertField(fields.dayOfYear); fields.monthOfYear = convertField(fields.monthOfYear); fields.weekOfWeekyear = convertField(fields.weekOfWeekyear); fields.weekyear = convertField(fields.weekyear); fields.weekyearOfCentury = convertField(fields.weekyearOfCentury); fields.millisOfSecond = convertField(fields.millisOfSecond); fields.millisOfDay = convertField(fields.millisOfDay); fields.secondOfMinute = convertField(fields.secondOfMinute); fields.secondOfDay = convertField(fields.secondOfDay); fields.minuteOfHour = convertField(fields.minuteOfHour); fields.minuteOfDay = convertField(fields.minuteOfDay); fields.hourOfDay = convertField(fields.hourOfDay); fields.hourOfHalfday = convertField(fields.hourOfHalfday); fields.clockhourOfDay = convertField(fields.clockhourOfDay); fields.clockhourOfHalfday = convertField(fields.clockhourOfHalfday); fields.halfdayOfDay = convertField(fields.halfdayOfDay); }
public Chronology withUTC() { if (iWithUTC == null) { if (getZone() == DateTimeZone.UTC) { iWithUTC = this; } else { iWithUTC = LenientChronology.getInstance(getBase().withUTC()); } } return iWithUTC; }
/** * A suitable hashcode for the chronology. * * @return the hashcode * @since 1.4 */ public int hashCode() { return 236548278 + getBase().hashCode() * 7; }
static Chronology getLenientISOChronology() { if (cLenientISO == null) { cLenientISO = LenientChronology.getInstance(ISOChronology.getInstanceUTC()); } return cLenientISO; }
public Chronology withUTC() { if (iWithUTC == null) { if (getZone() == DateTimeZone.UTC) { iWithUTC = this; } else { iWithUTC = LenientChronology.getInstance(getBase().withUTC()); } } return iWithUTC; }
/** * A suitable hashcode for the chronology. * * @return the hashcode * @since 1.4 */ public int hashCode() { return 236548278 + getBase().hashCode() * 7; }
static Chronology getLenientISOChronology() { if (cLenientISO == null) { cLenientISO = LenientChronology.getInstance(ISOChronology.getInstanceUTC()); } return cLenientISO; }
public Chronology withZone(DateTimeZone zone) { if (zone == null) { zone = DateTimeZone.getDefault(); } if (zone == DateTimeZone.UTC) { return withUTC(); } if (zone == getZone()) { return this; } return LenientChronology.getInstance(getBase().withZone(zone)); }
public Chronology withUTC() { if (iWithUTC == null) { if (getZone() == DateTimeZone.UTC) { iWithUTC = this; } else { iWithUTC = LenientChronology.getInstance(getBase().withUTC()); } } return iWithUTC; }
/** * A lenient chronology is only equal to a lenient chronology with the * same base chronology. * * @param obj the object to compare to * @return true if equal * @since 1.4 */ public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LenientChronology == false) { return false; } LenientChronology chrono = (LenientChronology) obj; return getBase().equals(chrono.getBase()); }
static Chronology getLenientISOChronology() { if (cLenientISO == null) { cLenientISO = LenientChronology.getInstance(ISOChronology.getInstanceUTC()); } return cLenientISO; }
/** * Create a LenientChronology for any chronology. * * @param base the chronology to wrap * @throws IllegalArgumentException if chronology is null */ public static LenientChronology getInstance(Chronology base) { if (base == null) { throw new IllegalArgumentException("Must supply a chronology"); } return new LenientChronology(base); }
protected void assemble(Fields fields) { fields.year = convertField(fields.year); fields.yearOfEra = convertField(fields.yearOfEra); fields.yearOfCentury = convertField(fields.yearOfCentury); fields.centuryOfEra = convertField(fields.centuryOfEra); fields.era = convertField(fields.era); fields.dayOfWeek = convertField(fields.dayOfWeek); fields.dayOfMonth = convertField(fields.dayOfMonth); fields.dayOfYear = convertField(fields.dayOfYear); fields.monthOfYear = convertField(fields.monthOfYear); fields.weekOfWeekyear = convertField(fields.weekOfWeekyear); fields.weekyear = convertField(fields.weekyear); fields.weekyearOfCentury = convertField(fields.weekyearOfCentury); fields.millisOfSecond = convertField(fields.millisOfSecond); fields.millisOfDay = convertField(fields.millisOfDay); fields.secondOfMinute = convertField(fields.secondOfMinute); fields.secondOfDay = convertField(fields.secondOfDay); fields.minuteOfHour = convertField(fields.minuteOfHour); fields.minuteOfDay = convertField(fields.minuteOfDay); fields.hourOfDay = convertField(fields.hourOfDay); fields.hourOfHalfday = convertField(fields.hourOfHalfday); fields.clockhourOfDay = convertField(fields.clockhourOfDay); fields.clockhourOfHalfday = convertField(fields.clockhourOfHalfday); fields.halfdayOfDay = convertField(fields.halfdayOfDay); }
public Chronology withZone(DateTimeZone zone) { if (zone == null) { zone = DateTimeZone.getDefault(); } if (zone == DateTimeZone.UTC) { return withUTC(); } if (zone == getZone()) { return this; } return LenientChronology.getInstance(getBase().withZone(zone)); }
public Chronology withUTC() { if (iWithUTC == null) { if (getZone() == DateTimeZone.UTC) { iWithUTC = this; } else { iWithUTC = LenientChronology.getInstance(getBase().withUTC()); } } return iWithUTC; }
/** * A lenient chronology is only equal to a lenient chronology with the * same base chronology. * * @param obj the object to compare to * @return true if equal * @since 1.4 */ public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LenientChronology == false) { return false; } LenientChronology chrono = (LenientChronology) obj; return getBase().equals(chrono.getBase()); }
static Chronology getLenientISOChronology() { if (cLenientISO == null) { cLenientISO = LenientChronology.getInstance(ISOChronology.getInstanceUTC()); } return cLenientISO; }
/** * Create a LenientChronology for any chronology. * * @param base the chronology to wrap * @throws IllegalArgumentException if chronology is null */ public static LenientChronology getInstance(Chronology base) { if (base == null) { throw new IllegalArgumentException("Must supply a chronology"); } return new LenientChronology(base); }