/** * Returns the minimum value of the given field for the current date. */ public int getActualMinimum(int field) { int value, next; if (getMinimum(field) == (next = getGreatestMinimum(field))) { return next; } complete(); long orgTime = time; set(field, next); do { value = next; roll(field, false); next = get(field); } while (next < value); time = orgTime; areFieldsSet = false; return value; }
/** * Method reduce_constant_length_field */ protected static void reduce_constant_length_field( int field, Calendar start, Calendar candidate) { if ((start.getMaximum(field) != start.getLeastMaximum(field)) || (start.getMinimum(field) != start.getGreatestMinimum(field))) { throw new IllegalArgumentException("Not a constant length field"); } int delta = start.get(field) - candidate.get(field); if (delta > 0) { int fieldLength = start.getMaximum(field) - start.getMinimum(field) + 1; delta -= fieldLength; } candidate.add(field, delta); }
@Override public int getGreatestMinimum(int field) { return wrapped.getGreatestMinimum(field); }
/** * Returns the highest minimum value for the given field if varies. * Otherwise same as getMinimum(). For Gregorian, no difference. * @param field the given time field. * @return the highest minimum value for the given time field. * @stable ICU 2.0 */ public final int getGreatestMinimum(int field) { return calendar.getGreatestMinimum(getJDKField(field)); }
/** * Returns the highest minimum value for the given field if varies. * Otherwise same as getMinimum(). For Gregorian, no difference. * @param field the given time field. * @return the highest minimum value for the given time field. * @stable ICU 2.0 */ public final int getGreatestMinimum(int field) { return calendar.getGreatestMinimum(getJDKField(field)); }
@Override public int getGreatestMinimum(int field) { Capturer.capture(Instrumenter.CAPTURE_ID_JAVA_UTIL_CALENDAR, this, "getGreatestMinimum", "(I)V", new Object[] {field}); int ret = wrappedCalendar.getGreatestMinimum(field); Capturer.enable(Instrumenter.CAPTURE_ID_JAVA_UTIL_CALENDAR, this, ret); return ret; }
int fieldValue = getGreatestMinimum(field); int endValue = getMinimum(field);
int fieldValue = getGreatestMinimum(field); int endValue = getMinimum(field);
/** * Returns the minimum value of the given field for the current date. */ public int getActualMinimum(int field) { int value, next; if (getMinimum(field) == (next = getGreatestMinimum(field))) { return next; } complete(); long orgTime = time; set(field, next); do { value = next; roll(field, false); next = get(field); } while (next < value); time = orgTime; areFieldsSet = false; return value; }
/** * Returns the minimum value of the given field for the current date. */ public int getActualMinimum(int field) { int value, next; if (getMinimum(field) == (next = getGreatestMinimum(field))) { return next; } complete(); long orgTime = time; set(field, next); do { value = next; roll(field, false); next = get(field); } while (next < value); time = orgTime; areFieldsSet = false; return value; }
/** * Returns the minimum value of the given field for the current date. */ public int getActualMinimum(int field) { int value, next; if (getMinimum(field) == (next = getGreatestMinimum(field))) { return next; } complete(); long orgTime = time; set(field, next); do { value = next; roll(field, false); next = get(field); } while (next < value); time = orgTime; areFieldsSet = false; return value; }
/** * Returns the minimum value of the given field for the current date. */ public int getActualMinimum(int field) { int value, next; if (getMinimum(field) == (next = getGreatestMinimum(field))) { return next; } complete(); long orgTime = time; set(field, next); do { value = next; roll(field, false); next = get(field); } while (next < value); time = orgTime; areFieldsSet = false; return value; }
/** * Returns the minimum value of the given field for the current date. */ public int getActualMinimum(int field) { int value, next; if (getMinimum(field) == (next = getGreatestMinimum(field))) { return next; } complete(); long orgTime = time; set(field, next); do { value = next; roll(field, false); next = get(field); } while (next < value); time = orgTime; areFieldsSet = false; return value; }
/** * Returns the minimum value of the given field for the current date. */ public int getActualMinimum(int field) { int value, next; if (getMinimum(field) == (next = getGreatestMinimum(field))) { return next; } complete(); long orgTime = time; set(field, next); do { value = next; roll(field, false); next = get(field); } while (next < value); time = orgTime; areFieldsSet = false; return value; }
/** * Returns the minimum value of the given field for the current date. */ public int getActualMinimum(int field) { int value, next; if (getMinimum(field) == (next = getGreatestMinimum(field))) { return next; } complete(); long orgTime = time; set(field, next); do { value = next; roll(field, false); next = get(field); } while (next < value); time = orgTime; areFieldsSet = false; return value; }
/** * Method reduce_constant_length_field * * * @param field * @param start * @param candidate * */ protected static void reduce_constant_length_field(int field, Calendar start, Calendar candidate) { if ((start.getMaximum(field) != start.getLeastMaximum(field)) || (start.getMinimum(field) != start.getGreatestMinimum(field))) { throw new IllegalArgumentException("Not a constant length field"); } int fieldLength = (start.getMaximum(field) - start.getMinimum(field) + 1); int delta = start.get(field) - candidate.get(field); if (delta > 0) { delta -= fieldLength; } candidate.add(field, delta); }
/** * Method reduce_constant_length_field * * * @param field * @param start * @param candidate * */ protected static void reduce_constant_length_field(int field, Calendar start, Calendar candidate) { if ((start.getMaximum(field) != start.getLeastMaximum(field)) || (start.getMinimum(field) != start.getGreatestMinimum(field))) { throw new IllegalArgumentException("Not a constant length field"); } int fieldLength = (start.getMaximum(field) - start.getMinimum(field) + 1); int delta = start.get(field) - candidate.get(field); if (delta > 0) { delta -= fieldLength; } candidate.add(field, delta); }
return ValueRange.of(jcal.getMinimum(Calendar.MONTH) + 1, jcal.getGreatestMinimum(Calendar.MONTH) + 1, jcal.getLeastMaximum(Calendar.MONTH) + 1, jcal.getMaximum(Calendar.MONTH) + 1); case DAY_OF_YEAR: {
return ValueRange.of(jcal.getMinimum(Calendar.MONTH) + 1, jcal.getGreatestMinimum(Calendar.MONTH) + 1, jcal.getLeastMaximum(Calendar.MONTH) + 1, jcal.getMaximum(Calendar.MONTH) + 1); case DAY_OF_YEAR: {
return ValueRange.of(jcal.getMinimum(Calendar.MONTH) + 1, jcal.getGreatestMinimum(Calendar.MONTH) + 1, jcal.getLeastMaximum(Calendar.MONTH) + 1, jcal.getMaximum(Calendar.MONTH) + 1); case DAY_OF_YEAR: {