LinkedDurationField(DurationField durationField, ImpreciseCutoverField dateTimeField) { super(durationField, durationField.getType()); iField = dateTimeField; }
LimitDurationField(DurationField field) { super(field, field.getType()); }
LinkedDurationField(DurationField durationField, ImpreciseCutoverField dateTimeField) { super(durationField, durationField.getType()); iField = dateTimeField; }
LimitDurationField(DurationField field) { super(field, field.getType()); }
/** * Constructor. * * @param field the base field * @param type the field type to use */ protected DelegatedDurationField(DurationField field, DurationFieldType type) { super(); if (field == null) { throw new IllegalArgumentException("The field must not be null"); } iField = field; iType = (type == null ? field.getType() : type); }
/** * Constructor. * * @param field the base field * @param type the field type to use */ protected DelegatedDurationField(DurationField field, DurationFieldType type) { super(); if (field == null) { throw new IllegalArgumentException("The field must not be null"); } iField = field; iType = (type == null ? field.getType() : type); }
ZonedDurationField(DurationField field, DateTimeZone zone) { super(field.getType()); if (!field.isSupported()) { throw new IllegalArgumentException(); } iField = field; iTimeField = useTimeArithmetic(field); iZone = zone; }
ZonedDurationField(DurationField field, DateTimeZone zone) { super(field.getType()); if (!field.isSupported()) { throw new IllegalArgumentException(); } iField = field; iTimeField = useTimeArithmetic(field); iZone = zone; }
protected static Period getJodaTimePeriod(Partial p) { if (p.size() > 0) { DateTimeFieldType dtType = p.getFieldType(p.size()-1); DurationFieldType dType = dtType.getDurationType(); Period period = new Period(); if (period.isSupported(dType)) { return period.withField(dType, 1); } else { DurationField df = dType.getField(p.getChronology()); if (df instanceof ScaledDurationField) { ScaledDurationField sdf = (ScaledDurationField) df; return period.withField(sdf.getWrappedField().getType(), sdf.getScalar()); } // PeriodType.forFields(new DurationFieldType[]{dType}); // return new Period(df.getUnitMillis(), PeriodType.forFields(new DurationFieldType[]{dType})); } } return null; } public static Partial combineMoreGeneralFields(Partial p1, Partial p2) {
if (lastUnitField.isSupported() && lastUnitField.getType() != DurationFieldType.YEARS_TYPE) { throw new IllegalArgumentException("Types array must be in order largest-smallest," + " for year-based fields, years is defined as being largest: " +
if (lastUnitField.isSupported() && lastUnitField.getType() != DurationFieldType.YEARS_TYPE) { throw new IllegalArgumentException("Types array must be in order largest-smallest," + " for year-based fields, years is defined as being largest: " +
LinkedDurationField(DurationField durationField, ImpreciseCutoverField dateTimeField) { super(durationField, durationField.getType()); iField = dateTimeField; }
/** * Constructor. * * @param field the base field * @param type the field type to use */ protected DelegatedDurationField(DurationField field, DurationFieldType type) { super(); if (field == null) { throw new IllegalArgumentException("The field must not be null"); } iField = field; iType = (type == null ? field.getType() : type); }
ZonedDurationField(DurationField field, DateTimeZone zone) { super(field.getType()); if (!field.isSupported()) { throw new IllegalArgumentException(); } iField = field; iTimeField = useTimeArithmetic(field); iZone = zone; }