/** * Get the millisecond duration of this field from its value, which is * approximate if this field is imprecise. * * @param value the value of the field, which may be negative * @return the milliseconds that the field represents, which may be * negative */ public long getMillis(int value) { return value * getUnitMillis(); // safe }
/** * Get the value of this field from the milliseconds, which is approximate * if this field is imprecise. * * @param duration the milliseconds to query, which may be negative * @return the value of the field, in the units of the field, which may be * negative */ public long getValueAsLong(long duration) { return duration / getUnitMillis(); }
/** * Get the value of this field from the milliseconds, which is approximate * if this field is imprecise. * * @param duration the milliseconds to query, which may be negative * @return the value of the field, in the units of the field, which may be * negative */ public long getValueAsLong(long duration) { return duration / getUnitMillis(); }
/** * Get the millisecond duration of this field from its value, which is * approximate if this field is imprecise. * * @param value the value of the field, which may be negative * @return the milliseconds that the field represents, which may be * negative */ public long getMillis(int value) { return value * getUnitMillis(); // safe }
/** * Get the millisecond duration of this field from its value, which is * approximate if this field is imprecise. * * @param value the value of the field, which may be negative * @return the milliseconds that the field represents, which may be * negative */ public long getMillis(long value) { return FieldUtils.safeMultiply(value, 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; } }
/** * Get the millisecond duration of this field from its value, which is * approximate if this field is imprecise. * * @param value the value of the field, which may be negative * @return the milliseconds that the field represents, which may be * negative */ public long getMillis(long value) { return FieldUtils.safeMultiply(value, 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; } }
/** * Get the millisecond duration of this field from its value, which is * approximate if this field is imprecise. * * @param value the value of the field, which may be negative * @return the milliseconds that the field represents, which may be * negative */ public long getMillis(int value) { return value * getUnitMillis(); // safe }
/** * Get the value of this field from the milliseconds, which is approximate * if this field is imprecise. * * @param duration the milliseconds to query, which may be negative * @return the value of the field, in the units of the field, which may be * negative */ public long getValueAsLong(long duration) { return duration / 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; } }
/** * Get the millisecond duration of this field from its value, which is * approximate if this field is imprecise. * * @param value the value of the field, which may be negative * @return the milliseconds that the field represents, which may be * negative */ public long getMillis(long value) { return FieldUtils.safeMultiply(value, getUnitMillis()); }
/** * Get the value of this field from the milliseconds, which is approximate * if this field is imprecise. * * @param duration the milliseconds to query, which may be negative * @return the value of the field, in the units of the field, which may be * negative */ public long getValueAsLong(long duration) { return duration / getUnitMillis(); }
/** * Get the value of this field from the milliseconds, which is approximate * if this field is imprecise. * * @param duration the milliseconds to query, which may be negative * @return the value of the field, in the units of the field, which may be * negative */ public long getValueAsLong(long duration) { return duration / getUnitMillis(); }
/** * Get the millisecond duration of this field from its value, which is * approximate if this field is imprecise. * * @param value the value of the field, which may be negative * @return the milliseconds that the field represents, which may be * negative */ public long getMillis(int value) { return value * getUnitMillis(); // safe }
/** * Get the value of this field from the milliseconds, which is approximate * if this field is imprecise. * * @param duration the milliseconds to query, which may be negative * @return the value of the field, in the units of the field, which may be * negative */ public long getValueAsLong(long duration) { return duration / getUnitMillis(); }
/** * Get the millisecond duration of this field from its value, which is * approximate if this field is imprecise. * * @param value the value of the field, which may be negative * @return the milliseconds that the field represents, which may be * negative */ public long getMillis(long value) { return FieldUtils.safeMultiply(value, getUnitMillis()); }
/** * Get the millisecond duration of this field from its value, which is * approximate if this field is imprecise. * * @param value the value of the field, which may be negative * @return the milliseconds that the field represents, which may be * negative */ public long getMillis(long value) { return FieldUtils.safeMultiply(value, getUnitMillis()); }
/** * Get the millisecond duration of this field from its value, which is * approximate if this field is imprecise. * * @param value the value of the field, which may be negative * @return the milliseconds that the field represents, which may be * negative */ public long getMillis(long value) { return FieldUtils.safeMultiply(value, getUnitMillis()); }
/** * Get the millisecond duration of this field from its value, which is * approximate if this field is imprecise. * * @param value the value of the field, which may be negative * @return the milliseconds that the field represents, which may be * negative */ public long getMillis(long value) { return FieldUtils.safeMultiply(value, getUnitMillis()); }