/** * Returns the time represented by this {@code Calendar}, recomputing the time from its * fields if necessary. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ public long getTimeInMillis() { if (!isTimeSet) { computeTime(); isTimeSet = true; } return time; }
/** * 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; } }
/** * Recomputes the time and updates the status fields isTimeSet * and areFieldsSet. Callers should check isTimeSet and only * call this method if isTimeSet is false. */ private void updateTime() { computeTime(); // The areFieldsSet and areAllFieldsSet values are no longer // controlled here (as of 1.5). isTimeSet = true; }
/** * Recomputes the time and updates the status fields isTimeSet * and areFieldsSet. Callers should check isTimeSet and only * call this method if isTimeSet is false. */ private void updateTime() { computeTime(); // The areFieldsSet and areAllFieldsSet values are no longer // controlled here (as of 1.5). isTimeSet = true; }
/** * Returns the time represented by this {@code Calendar}, recomputing the time from its * fields if necessary. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ public long getTimeInMillis() { if (!isTimeSet) { computeTime(); isTimeSet = true; } return time; }
/** * Returns the time represented by this {@code Calendar}, recomputing the time from its * fields if necessary. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ public long getTimeInMillis() { if (!isTimeSet) { computeTime(); isTimeSet = true; } return time; }
/** * Returns the time represented by this {@code Calendar}, recomputing the time from its * fields if necessary. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ public long getTimeInMillis() { if (!isTimeSet) { computeTime(); isTimeSet = true; } return time; }
/** * Returns the time represented by this {@code Calendar}, recomputing the time from its * fields if necessary. * * @throws IllegalArgumentException if the time is not set and the time cannot be computed * from the current field values. */ public long getTimeInMillis() { if (!isTimeSet) { computeTime(); isTimeSet = true; } return time; }
/** * Returns the time represented by this {@code Calendar}, recomputing the time from its * fields if necessary. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ public long getTimeInMillis() { if (!isTimeSet) { computeTime(); isTimeSet = true; } return time; }
/** * Returns the time represented by this {@code Calendar}, recomputing the time from its * fields if necessary. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ public long getTimeInMillis() { if (!isTimeSet) { computeTime(); isTimeSet = true; } return time; }
/** * Returns the time represented by this {@code Calendar}, recomputing the time from its * fields if necessary. * * @throws IllegalArgumentException * if the time is not set and the time cannot be computed * from the current field values. */ public long getTimeInMillis() { if (!isTimeSet) { computeTime(); isTimeSet = true; } return time; }
Calendar c = Calendar.getInstance(); c.set(Calendar.DATE, c.get(Calendar.DATE) - 1); c.computeTime(); // Make sure getTime returns the updated time
/** * 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; } }
/** * 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; } }