/** * Gets the duration field type, which is <code>minutes</code>. * * @return the period type */ public DurationFieldType getFieldType() { return DurationFieldType.minutes(); }
/** * Gets the duration field type, which is <code>minutes</code>. * * @return the period type */ public DurationFieldType getFieldType() { return DurationFieldType.minutes(); }
/** * Sets the number of minutes of the period. * * @param minutes the number of minutes * @throws IllegalArgumentException if field is not supported and the value is non-zero */ public void setMinutes(int minutes) { super.setField(DurationFieldType.minutes(), minutes); }
/** * Adds the specified minutes to the number of minutes in the period. * * @param minutes the number of minutes * @throws IllegalArgumentException if field is not supported and the value is non-zero * @throws ArithmeticException if the addition exceeds the capacity of the period */ public void addMinutes(int minutes) { super.addField(DurationFieldType.minutes(), minutes); }
/** * Get the minutes duration field for this chronology. * * @return DurationField or UnsupportedDurationField if unsupported */ public DurationField minutes() { return UnsupportedDurationField.getInstance(DurationFieldType.minutes()); }
/** * Get the minutes duration field for this chronology. * * @return DurationField or UnsupportedDurationField if unsupported */ public DurationField minutes() { return UnsupportedDurationField.getInstance(DurationFieldType.minutes()); }
/** * Sets the number of minutes of the period. * * @param minutes the number of minutes * @throws IllegalArgumentException if field is not supported and the value is non-zero */ public void setMinutes(int minutes) { super.setField(DurationFieldType.minutes(), minutes); }
/** * Adds the specified minutes to the number of minutes in the period. * * @param minutes the number of minutes * @throws IllegalArgumentException if field is not supported and the value is non-zero * @throws ArithmeticException if the addition exceeds the capacity of the period */ public void addMinutes(int minutes) { super.addField(DurationFieldType.minutes(), minutes); }
/** * Gets a type that defines just the minutes field. * * @return the period type */ public static PeriodType minutes() { PeriodType type = cMinutes; if (type == null) { type = new PeriodType( "Minutes", new DurationFieldType[] { DurationFieldType.minutes() }, new int[] { -1, -1, -1, -1, -1, 0, -1, -1, } ); cMinutes = type; } return type; }
/** * Returns a copy of this time plus the specified number of minutes. * <p> * This time instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * TimeOfDay added = dt.plusMinutes(6); * TimeOfDay added = dt.plus(Period.minutes(6)); * TimeOfDay added = dt.withFieldAdded(DurationFieldType.minutes(), 6); * </pre> * * @param minutes the amount of minutes to add, may be negative * @return the new time plus the increased minutes * @since 1.1 */ public TimeOfDay plusMinutes(int minutes) { return withFieldAdded(DurationFieldType.minutes(), minutes); }
/** * Gets a type that defines just the minutes field. * * @return the period type */ public static PeriodType minutes() { PeriodType type = cMinutes; if (type == null) { type = new PeriodType( "Minutes", new DurationFieldType[] { DurationFieldType.minutes() }, new int[] { -1, -1, -1, -1, -1, 0, -1, -1, } ); cMinutes = type; } return type; }
/** * Returns a copy of this time plus the specified number of minutes. * <p> * This time instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * TimeOfDay added = dt.plusMinutes(6); * TimeOfDay added = dt.plus(Period.minutes(6)); * TimeOfDay added = dt.withFieldAdded(DurationFieldType.minutes(), 6); * </pre> * * @param minutes the amount of minutes to add, may be negative * @return the new time plus the increased minutes * @since 1.1 */ public TimeOfDay plusMinutes(int minutes) { return withFieldAdded(DurationFieldType.minutes(), minutes); }
/** * Creates a <code>Minutes</code> representing the number of whole minutes * between the two specified datetimes. * * @param start the start instant, must not be null * @param end the end instant, must not be null * @return the period in minutes * @throws IllegalArgumentException if the instants are null or invalid */ public static Minutes minutesBetween(ReadableInstant start, ReadableInstant end) { int amount = BaseSingleFieldPeriod.between(start, end, DurationFieldType.minutes()); return Minutes.minutes(amount); }
/** * Creates a <code>Minutes</code> representing the number of whole minutes * between the two specified datetimes. * * @param start the start instant, must not be null * @param end the end instant, must not be null * @return the period in minutes * @throws IllegalArgumentException if the instants are null or invalid */ public static Minutes minutesBetween(ReadableInstant start, ReadableInstant end) { int amount = BaseSingleFieldPeriod.between(start, end, DurationFieldType.minutes()); return Minutes.minutes(amount); }
/** * Returns a copy of this time minus the specified number of minutes. * <p> * This time instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * TimeOfDay subtracted = dt.minusMinutes(6); * TimeOfDay subtracted = dt.minus(Period.minutes(6)); * TimeOfDay subtracted = dt.withFieldAdded(DurationFieldType.minutes(), -6); * </pre> * * @param minutes the amount of minutes to subtract, may be negative * @return the new time minus the increased minutes * @since 1.1 */ public TimeOfDay minusMinutes(int minutes) { return withFieldAdded(DurationFieldType.minutes(), FieldUtils.safeNegate(minutes)); }
/** * Returns a copy of this time minus the specified number of minutes. * <p> * This time instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * TimeOfDay subtracted = dt.minusMinutes(6); * TimeOfDay subtracted = dt.minus(Period.minutes(6)); * TimeOfDay subtracted = dt.withFieldAdded(DurationFieldType.minutes(), -6); * </pre> * * @param minutes the amount of minutes to subtract, may be negative * @return the new time minus the increased minutes * @since 1.1 */ public TimeOfDay minusMinutes(int minutes) { return withFieldAdded(DurationFieldType.minutes(), FieldUtils.safeNegate(minutes)); }
/** * Creates a <code>Minutes</code> representing the number of whole minutes * in the specified interval. * * @param interval the interval to extract minutes from, null returns zero * @return the period in minutes * @throws IllegalArgumentException if the partials are null or invalid */ public static Minutes minutesIn(ReadableInterval interval) { if (interval == null) { return Minutes.ZERO; } int amount = BaseSingleFieldPeriod.between(interval.getStart(), interval.getEnd(), DurationFieldType.minutes()); return Minutes.minutes(amount); }
/** * Creates a <code>Minutes</code> representing the number of whole minutes * in the specified interval. * * @param interval the interval to extract minutes from, null returns zero * @return the period in minutes * @throws IllegalArgumentException if the partials are null or invalid */ public static Minutes minutesIn(ReadableInterval interval) { if (interval == null) { return Minutes.ZERO; } int amount = BaseSingleFieldPeriod.between(interval.getStart(), interval.getEnd(), DurationFieldType.minutes()); return Minutes.minutes(amount); }
/** * Private method called from constructor. */ private int[] setPeriodInternal(int years, int months, int weeks, int days, int hours, int minutes, int seconds, int millis) { int[] newValues = new int[size()]; checkAndUpdate(DurationFieldType.years(), newValues, years); checkAndUpdate(DurationFieldType.months(), newValues, months); checkAndUpdate(DurationFieldType.weeks(), newValues, weeks); checkAndUpdate(DurationFieldType.days(), newValues, days); checkAndUpdate(DurationFieldType.hours(), newValues, hours); checkAndUpdate(DurationFieldType.minutes(), newValues, minutes); checkAndUpdate(DurationFieldType.seconds(), newValues, seconds); checkAndUpdate(DurationFieldType.millis(), newValues, millis); return newValues; }
/** * Private method called from constructor. */ private int[] setPeriodInternal(int years, int months, int weeks, int days, int hours, int minutes, int seconds, int millis) { int[] newValues = new int[size()]; checkAndUpdate(DurationFieldType.years(), newValues, years); checkAndUpdate(DurationFieldType.months(), newValues, months); checkAndUpdate(DurationFieldType.weeks(), newValues, weeks); checkAndUpdate(DurationFieldType.days(), newValues, days); checkAndUpdate(DurationFieldType.hours(), newValues, hours); checkAndUpdate(DurationFieldType.minutes(), newValues, minutes); checkAndUpdate(DurationFieldType.seconds(), newValues, seconds); checkAndUpdate(DurationFieldType.millis(), newValues, millis); return newValues; }