static boolean useTimeArithmetic(DurationField field) { // Use time of day arithmetic rules for unit durations less than // typical time zone offsets. return field != null && field.getUnitMillis() < DateTimeConstants.MILLIS_PER_HOUR * 12; }
static boolean useTimeArithmetic(DurationField field) { // Use time of day arithmetic rules for unit durations less than // typical time zone offsets. return field != null && field.getUnitMillis() < DateTimeConstants.MILLIS_PER_HOUR * 12; }
public long getUnitMillis() { return iField.getUnitMillis(); }
public long getUnitMillis() { return iField.getUnitMillis(); }
public long getUnitMillis() { return iField.getUnitMillis(); }
public long getUnitMillis() { return iField.getUnitMillis(); }
public long getUnitMillis() { return iField.getUnitMillis(); }
public long getUnitMillis() { return iField.getUnitMillis(); }
public int compareTo(DurationField otherField) { long otherMillis = otherField.getUnitMillis(); long thisMillis = getUnitMillis(); // cannot do (thisMillis - otherMillis) as can overflow if (thisMillis == otherMillis) { return 0; } if (thisMillis < otherMillis) { return -1; } else { return 1; } }
public int compareTo(DurationField otherField) { long otherMillis = otherField.getUnitMillis(); long thisMillis = getUnitMillis(); // cannot do (thisMillis - otherMillis) as can overflow if (thisMillis == otherMillis) { return 0; } if (thisMillis < otherMillis) { return -1; } else { return 1; } }
public long getUnitMillis() { return getWrappedField().getUnitMillis() * iScalar; }
public int compareTo(DurationField otherField) { long otherMillis = otherField.getUnitMillis(); long thisMillis = getUnitMillis(); // cannot do (thisMillis - otherMillis) as can overflow if (thisMillis == otherMillis) { return 0; } if (thisMillis < otherMillis) { return -1; } else { return 1; } }
public int compareTo(DurationField otherField) { long otherMillis = otherField.getUnitMillis(); long thisMillis = getUnitMillis(); // cannot do (thisMillis - otherMillis) as can overflow if (thisMillis == otherMillis) { return 0; } if (thisMillis < otherMillis) { return -1; } else { return 1; } }
public long getUnitMillis() { return getWrappedField().getUnitMillis() * iScalar; }
/** * Constructor. * * @param type the field type * @param unit precise unit duration, like "days()". * @throws IllegalArgumentException if duration field is imprecise * @throws IllegalArgumentException if unit milliseconds is less than one */ public PreciseDurationDateTimeField(DateTimeFieldType type, DurationField unit) { super(type); if (!unit.isPrecise()) { throw new IllegalArgumentException("Unit duration field must be precise"); } iUnitMillis = unit.getUnitMillis(); if (iUnitMillis < 1) { throw new IllegalArgumentException("The unit milliseconds must be at least 1"); } iUnitField = unit; }
/** * Checks if the duration type specified is supported by this * local time and chronology. * * @param type a duration type, usually obtained from DurationFieldType * @return true if the field type is supported */ public boolean isSupported(DurationFieldType type) { if (type == null) { return false; } DurationField field = type.getField(getChronology()); if (TIME_DURATION_TYPES.contains(type) || field.getUnitMillis() < getChronology().days().getUnitMillis()) { return field.isSupported(); } return false; }
/** * Checks if the duration type specified is supported by this * local date and chronology. * * @param type a duration type, usually obtained from DurationFieldType * @return true if the field type is supported */ public boolean isSupported(DurationFieldType type) { if (type == null) { return false; } DurationField field = type.getField(getChronology()); if (DATE_DURATION_TYPES.contains(type) || field.getUnitMillis() >= getChronology().days().getUnitMillis()) { return field.isSupported(); } return false; }
/** * Checks if the duration type specified is supported by this * local time and chronology. * * @param type a duration type, usually obtained from DurationFieldType * @return true if the field type is supported */ public boolean isSupported(DurationFieldType type) { if (type == null) { return false; } DurationField field = type.getField(getChronology()); if (TIME_DURATION_TYPES.contains(type) || field.getUnitMillis() < getChronology().days().getUnitMillis()) { return field.isSupported(); } return false; }
/** * Get the number of milliseconds associated with a partition type. Eg * getUnitMilliseconds() of DatePartitionType.MINUTE = 60,000. */ public long getUnitMilliseconds() { return dateTimeField.getDurationType().getField(ISOChronology.getInstance()).getUnitMillis(); }
/** * Checks if the field type specified is supported by this * local date and chronology. * This can be used to avoid exceptions in {@link #get(DateTimeFieldType)}. * * @param type a field type, usually obtained from DateTimeFieldType * @return true if the field type is supported */ public boolean isSupported(DateTimeFieldType type) { if (type == null) { return false; } DurationFieldType durType = type.getDurationType(); if (DATE_DURATION_TYPES.contains(durType) || durType.getField(getChronology()).getUnitMillis() >= getChronology().days().getUnitMillis()) { return type.getField(getChronology()).isSupported(); } return false; }