Collaboration diagram for Comparisons:
Comparisons | |
(BOOL) | + equalFrom:to:with: |
Test whether two ranges are equal. | |
(BOOL) | + equalFrom:to:with:predicate: |
Test whether two ranges are equal. | |
(BOOL) | + lexicographicalCompareFrom:to:andFrom:andTo: |
Compare two ranges lexicographically. | |
(BOOL) | + lexicographicalCompareFrom:to:andFrom:andTo:predicate: |
Compare two ranges lexicographically. | |
(id) | + max:or: |
Return the maximum of two elements. | |
(id) | + max:or:predicate: |
Return the maximum of two elements. | |
(id) | + min:or: |
Return the minimum of two elements. | |
(id) | + min:or:predicate: |
Return the minimum of two elements. |
Tests for eqaulity of ranges and comparisons of ranges are included, as well as tests for finding the maximum or minimum of two elements.
+ (BOOL) equalFrom: | (OLForwardIterator *) | first | ||
to: | (OLForwardIterator *) | last | ||
with: | (OLForwardIterator *) | first2 | ||
Test whether two ranges are equal.
This message sends the message equalFrom:to:with:predicate: using OLEqualTo as the predicate.
first | the first in the range of elements to test | |
last | one position beyond the last in the range of elements to test | |
first2 | the first in the second range to test |
+ (BOOL) equalFrom: | (OLForwardIterator *) | first | ||
to: | (OLForwardIterator *) | last | ||
with: | (OLForwardIterator *) | first2 | ||
predicate: | (id< OLBoolBinaryFunction >) | pred | ||
Test whether two ranges are equal.
Each element in the range [first, last)
is tested with the corresponding element from the range starting with first2 using the function object pred. If pred returns YES for each of its tests, then this message returns YES.
first | the first in the range of elements to test | |
last | one position beyond the last in the range of elements to test | |
first2 | the first in the second range to test | |
pred | the function object for testing |
+ (BOOL) lexicographicalCompareFrom: | (OLForwardIterator *) | first1 | ||
to: | (OLForwardIterator *) | last1 | ||
andFrom: | (OLForwardIterator *) | first2 | ||
andTo: | (OLForwardIterator *) | last2 | ||
Compare two ranges lexicographically.
This message simply sends the message lexicographicalCompareFrom:to:andFrom:andTo:predicate: using OLLess as the predicate.
first1 | the first in the first range of elements to test | |
last1 | one position beyond the last in the first range of elements to test | |
first2 | the first in the second range of elements to test | |
last2 | one position beyond the last in the second range of elements to test |
+ (BOOL) lexicographicalCompareFrom: | (OLForwardIterator *) | first1 | ||
to: | (OLForwardIterator *) | last1 | ||
andFrom: | (OLForwardIterator *) | first2 | ||
andTo: | (OLForwardIterator *) | last2 | ||
predicate: | (id< OLBoolBinaryFunction >) | pred | ||
Compare two ranges lexicographically.
A lexicographical comparison is one where each of the elements in the range [first1, last1)
is compared with each of the elements in the range [first2, last2)
. If each element in the first range satisfies the predicate pred when compared to its corresponding element in the second range, then YES is returned.
first1 | the first in the first range of elements to test | |
last1 | one position beyond the last in the first range of elements to test | |
first2 | the first in the second range of elements to test | |
last2 | one position beyond the last in the second range of elements to test | |
pred | the predicate used to compare elements in the two ranges |
+ (id) max: | (id) | left | ||
or: | (id) | right | ||
Return the maximum of two elements.
This message simply sends the message max:or:predicate: using OLLess as the predicate.
left | the first element to compare | |
right | the second element to compare |
+ (id) max: | (id) | left | ||
or: | (id) | right | ||
predicate: | (id< OLBoolBinaryFunction >) | pred | ||
Return the maximum of two elements.
The two elements are compared using the predicate pred with left passed as the first argument to the predicate and right passed as the second argument. If the predicate returns YES, then right is returned, otherwise left is returned.
left | the first element to compare | |
right | the second element to compare | |
pred | the predicate that is used to compare the two objects |
+ (id) min: | (id) | left | ||
or: | (id) | right | ||
Return the minimum of two elements.
This message simply sends the message min:or:predicate: using OLLess as the predicate.
left | the first element to compare | |
right | the second element to compare |
+ (id) min: | (id) | left | ||
or: | (id) | right | ||
predicate: | (id< OLBoolBinaryFunction >) | pred | ||
Return the minimum of two elements.
The two elements are compared using the predicate pred with left passed as the first argument to the predicate and right passed as the second argument. If the predicate returns YES, then left is returned, otherwise right is returned.
left | the first element to compare | |
right | the second element to compare | |
pred | the predicate that is used to compare the two objects |
|