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

UnicodeSet & UnicodeSet::retain ( UChar32  start,
UChar32  end 
) [virtual]

Retain only the elements in this set that are contained in the specified range. If end > start then an empty range is retained, leaving the set empty. This is equivalent to a boolean logic AND, or a set INTERSECTION. A frozen set will not be modified.

Parameters:
start first character, inclusive, of range to be retained to this set.
end last character, inclusive, of range to be retained to this set. ICU 2.0
Retain only the elements in this set that are contained in the specified range. If end > start then an empty range is retained, leaving the set empty.

Parameters:
start first character, inclusive, of range to be retained to this set.
end last character, inclusive, of range to be retained to this set.

Definition at line 1152 of file uniset.cpp.

References clear().

Referenced by remove(), removeAll(), retain(), and retainAll().

                                                         {
    if (pinCodePoint(start) <= pinCodePoint(end)) {
        UChar32 range[3] = { start, end+1, UNICODESET_HIGH };
        retain(range, 2, 0);
    } else {
        clear();
    }
    return *this;
}


Generated by  Doxygen 1.6.0   Back to index