/** * 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); }
public boolean isPrecise() { return iField.isPrecise(); }
/** Returns true if this field is supported. */ public boolean isSupported() { return iField.isSupported(); }
public String toString() { return (iType == null) ? iField.toString() : ("DurationField[" + iType + ']'); }
public boolean equals(Object obj) { if (obj instanceof DelegatedDurationField) { return iField.equals(((DelegatedDurationField) obj).iField); } return false; }
public int hashCode() { return iField.hashCode() ^ iType.hashCode(); }
public long getUnitMillis() { return iField.getUnitMillis(); }
public long getValueAsLong(long duration, long instant) { return iField.getValueAsLong(duration, instant); }
public int getDifference(long minuendInstant, long subtrahendInstant) { return iField.getDifference(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return iField.getDifferenceAsLong(minuendInstant, subtrahendInstant); }
public long add(long instant, long value) { return iField.add(instant, value); }
public long getMillis(long value, long instant) { return iField.getMillis(value, instant); }
public long getMillis(long value) { return iField.getMillis(value); }
public int getValue(long duration) { return iField.getValue(duration); }
public int compareTo(DurationField durationField) { return iField.compareTo(durationField); }
public long getValueAsLong(long duration) { return iField.getValueAsLong(duration); }
public int getValue(long duration, long instant) { return iField.getValue(duration, instant); }