/** * Computes the time from the fields if the time has not already been set. * Computes the fields from the time if the fields are not already set. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ protected void complete() { if (!isTimeSet) { computeTime(); isTimeSet = true; } if (!areFieldsSet) { computeFields(); areFieldsSet = true; } }
/** * Sets this Calendar's current time from the given long value. * * @param millis the new time in UTC milliseconds from the epoch. * @see #setTime(Date) * @see #getTimeInMillis() */ public void setTimeInMillis(long millis) { // If we don't need to recalculate the calendar field values, // do nothing. // if (time == millis && isTimeSet && areFieldsSet && areAllFieldsSet // && (zone instanceof ZoneInfo) && !((ZoneInfo)zone).isDirty()) { // return; // } time = millis; isTimeSet = true; areFieldsSet = false; computeFields(); areAllFieldsSet = areFieldsSet = true; }
/** * Sets this Calendar's current time from the given long value. * * @param millis the new time in UTC milliseconds from the epoch. * @see #setTime(Date) * @see #getTimeInMillis() */ public void setTimeInMillis(long millis) { // If we don't need to recalculate the calendar field values, // do nothing. // if (time == millis && isTimeSet && areFieldsSet && areAllFieldsSet // && (zone instanceof ZoneInfo) && !((ZoneInfo)zone).isDirty()) { // return; // } time = millis; isTimeSet = true; areFieldsSet = false; computeFields(); areAllFieldsSet = areFieldsSet = true; }
/** * Computes the time from the fields if the time has not already been set. * Computes the fields from the time if the fields are not already set. * * @throws IllegalArgumentException if the time is not set and the time cannot be computed * from the current field values. */ protected void complete() { if (!isTimeSet) { computeTime(); isTimeSet = true; } if (!areFieldsSet) { computeFields(); areFieldsSet = true; } }
/** * Fills in any unset fields in the calendar fields. First, the {@link * #computeTime()} method is called if the time value (millisecond offset * from the <a href="#Epoch">Epoch</a>) has not been calculated from * calendar field values. Then, the {@link #computeFields()} method is * called to calculate all calendar field values. */ protected void complete() { if (!isTimeSet) updateTime(); if (!areFieldsSet || !areAllFieldsSet) { computeFields(); // fills in unset fields areAllFieldsSet = areFieldsSet = true; } }
/** * Computes the time from the fields if the time has not already been set. * Computes the fields from the time if the fields are not already set. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ protected void complete() { if (!isTimeSet) { computeTime(); isTimeSet = true; } if (!areFieldsSet) { computeFields(); areFieldsSet = true; } }
/** * Computes the time from the fields if the time has not already been set. * Computes the fields from the time if the fields are not already set. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ protected void complete() { if (!isTimeSet) { computeTime(); isTimeSet = true; } if (!areFieldsSet) { computeFields(); areFieldsSet = true; } }
/** * Fills in any unset fields in the calendar fields. First, the {@link * #computeTime()} method is called if the time value (millisecond offset * from the <a href="#Epoch">Epoch</a>) has not been calculated from * calendar field values. Then, the {@link #computeFields()} method is * called to calculate all calendar field values. */ protected void complete() { if (!isTimeSet) updateTime(); if (!areFieldsSet || !areAllFieldsSet) { computeFields(); // fills in unset fields areAllFieldsSet = areFieldsSet = true; } }
/** * Computes the time from the fields if the time has not already been set. * Computes the fields from the time if the fields are not already set. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ protected void complete() { if (!isTimeSet) { computeTime(); isTimeSet = true; } if (!areFieldsSet) { computeFields(); areFieldsSet = true; } }
/** * Computes the time from the fields if the time has not already been set. * Computes the fields from the time if the fields are not already set. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ protected void complete() { if (!isTimeSet) { computeTime(); isTimeSet = true; } if (!areFieldsSet) { computeFields(); areFieldsSet = true; } }
/** * Computes the time from the fields if the time has not already been set. * Computes the fields from the time if the fields are not already set. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ protected void complete() { if (!isTimeSet) { computeTime(); isTimeSet = true; } if (!areFieldsSet) { computeFields(); areFieldsSet = true; } }
/** * Computes the time from the fields if the time has not already been set. * Computes the fields from the time if the fields are not already set. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ protected void complete() { if (!isTimeSet) { computeTime(); isTimeSet = true; } if (!areFieldsSet) { computeFields(); areFieldsSet = true; } }
/** * Sets the given calendar field to the given value. The value is not * interpreted by this method regardless of the leniency mode. * * @param field the given calendar field. * @param value the value to be set for the given calendar field. * @throws ArrayIndexOutOfBoundsException if the specified field is out of range * (<code>field < 0 || field >= FIELD_COUNT</code>). * in non-lenient mode. * @see #set(int,int,int) * @see #set(int,int,int,int,int) * @see #set(int,int,int,int,int,int) * @see #get(int) */ public void set(int field, int value) { // If the fields are partially normalized, calculate all the // fields before changing any fields. if (areFieldsSet && !areAllFieldsSet) { computeFields(); } internalSet(field, value); isTimeSet = false; areFieldsSet = false; isSet[field] = true; stamp[field] = nextStamp++; if (nextStamp == Integer.MAX_VALUE) { adjustStamp(); } }
/** * Sets the given calendar field to the given value. The value is not * interpreted by this method regardless of the leniency mode. * * @param field the given calendar field. * @param value the value to be set for the given calendar field. * @throws ArrayIndexOutOfBoundsException if the specified field is out of range * (<code>field < 0 || field >= FIELD_COUNT</code>). * in non-lenient mode. * @see #set(int,int,int) * @see #set(int,int,int,int,int) * @see #set(int,int,int,int,int,int) * @see #get(int) */ public void set(int field, int value) { // If the fields are partially normalized, calculate all the // fields before changing any fields. if (areFieldsSet && !areAllFieldsSet) { computeFields(); } internalSet(field, value); isTimeSet = false; areFieldsSet = false; isSet[field] = true; stamp[field] = nextStamp++; if (nextStamp == Integer.MAX_VALUE) { adjustStamp(); } }