Logo Search packages:      
Sourcecode: icu version File versions  Download package

void Calendar::validateField ( UCalendarDateFields  field,
int32_t  min,
int32_t  max,
UErrorCode status 
) [private]

Validate a single field of this calendar given its minimum and maximum allowed value. If the field is out of range, U_ILLEGAL_ARGUMENT_ERROR will be set. Subclasses may use this method in their implementation of validateField(int, int&).

For internal use only.

Validate a single field of this calendar given its minimum and maximum allowed value. If the field is out of range, throw a descriptive IllegalArgumentException. Subclasses may use this method in their implementation of validateField(int).

Definition at line 2301 of file calendar.cpp.

References fFields, and U_ILLEGAL_ARGUMENT_ERROR.

{
    int32_t value = fFields[field];
    if (value < min || value > max) {
#if defined (U_DEBUG_CAL)
        fprintf(stderr, "%s:%d: ILLEGAL ARG because of field %s out of range %d..%d  at %d\n", 
            __FILE__, __LINE__,fldName(field),min,max,value);
#endif
        status = U_ILLEGAL_ARGUMENT_ERROR;
        return;
    }
}


Generated by  Doxygen 1.6.0   Back to index