ZonedDateTimeField( DateTimeField field, DateTimeZone zone, DurationField durationField, DurationField rangeDurationField, DurationField leapDurationField) { super(field.getType()); if (!field.isSupported()) { throw new IllegalArgumentException(); } iField = field; iZone = zone; iDurationField = durationField; iTimeField = useTimeArithmetic(durationField); iRangeDurationField = rangeDurationField; iLeapDurationField = leapDurationField; }
private DateTimeField convertField(DateTimeField field, HashMap<Object, Object> converted) { if (field == null || !field.isSupported()) { return field; } if (converted.containsKey(field)) { return (DateTimeField) converted.get(field); } ZonedDateTimeField zonedField = new ZonedDateTimeField( field, getZone(), convertField(field.getDurationField(), converted), convertField(field.getRangeDurationField(), converted), convertField(field.getLeapDurationField(), converted)); converted.put(field, zonedField); return zonedField; }