Logo Search packages:      
Sourcecode: icu version File versions

UBool DateIntervalFormat::operator== ( const Format other  )  const [virtual]

Return true if the given Format objects are semantically equal. Objects of different subclasses are considered unequal.

Parameters:
other the object to be compared with.
Returns:
true if the given Format objects are semantically equal. ICU 4.0

Implements Format.

Definition at line 190 of file dtitvfmt.cpp.

References FALSE, fDateFormat, fDtpng, fFromCalendar, fInfo, fIntervalPatterns, fSkeleton, fToCalendar, Format::getDynamicClassID(), getStaticClassID(), Calendar::isEquivalentTo(), and TRUE.

Referenced by operator!=().

                                                        {
    if ( other.getDynamicClassID() == DateIntervalFormat::getStaticClassID() ) {
        DateIntervalFormat* fmt = (DateIntervalFormat*)&other;
#ifdef DTITVFMT_DEBUG
    UBool equal;
    equal = (this == fmt);
    
    equal = (*fInfo == *fmt->fInfo);
    equal = (*fDateFormat == *fmt->fDateFormat);
    equal = fFromCalendar->isEquivalentTo(*fmt->fFromCalendar) ;
    equal = fToCalendar->isEquivalentTo(*fmt->fToCalendar) ;
    equal = (fSkeleton == fmt->fSkeleton);
#endif
        UBool res;
        res =  ( this == fmt ) ||
               ( Format::operator==(other) && 
                 fInfo && 
                 ( *fInfo == *fmt->fInfo ) &&
                 fDateFormat &&
                 ( *fDateFormat == *fmt->fDateFormat ) &&
                 fFromCalendar &&
                 fFromCalendar->isEquivalentTo(*fmt->fFromCalendar) &&
                 fToCalendar &&
                 fToCalendar->isEquivalentTo(*fmt->fToCalendar) &&
                 fSkeleton == fmt->fSkeleton &&
                 fDtpng &&
                 (*fDtpng == *fmt->fDtpng) );
        int8_t i;
        for (i = 0; i< DateIntervalInfo::kIPI_MAX_INDEX && res == TRUE; ++i ) {
            res =   ( fIntervalPatterns[i].firstPart ==
                      fmt->fIntervalPatterns[i].firstPart) &&
                    ( fIntervalPatterns[i].secondPart ==
                      fmt->fIntervalPatterns[i].secondPart ) &&
                    ( fIntervalPatterns[i].laterDateFirst ==
                      fmt->fIntervalPatterns[i].laterDateFirst) ;
        }
        return res;
    } 
    return FALSE;
}


Generated by  Doxygen 1.6.0   Back to index