18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#import "OFObject.h"
#import "OFCollection.h"
@class OFMutableDictionary;
@class OFArray;
/**
* \brief An unordered set of unique objects.
*/
@interface OFSet: OFObject <OFCollection, OFCopying, OFMutableCopying>
{
OFMutableDictionary *dictionary;
}
|
>
>
>
>
>
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#import "OFObject.h"
#import "OFCollection.h"
@class OFMutableDictionary;
@class OFArray;
#ifdef OF_HAVE_BLOCKS
typedef void (^of_set_enumeration_block_t)(id object, BOOL *stop);
typedef BOOL (^of_set_filter_block_t)(id object);
#endif
/**
* \brief An unordered set of unique objects.
*/
@interface OFSet: OFObject <OFCollection, OFCopying, OFMutableCopying>
{
OFMutableDictionary *dictionary;
}
|
107
108
109
110
111
112
113
114
115
116
|
* \brief Returns whether the receiver and the specified set have at least one
* object in common.
*
* \return Whether the receiver and the specified set have at least one object
* in common
*/
- (BOOL)intersectsSet: (OFSet*)set;
@end
#import "OFMutableSet.h"
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
* \brief Returns whether the receiver and the specified set have at least one
* object in common.
*
* \return Whether the receiver and the specified set have at least one object
* in common
*/
- (BOOL)intersectsSet: (OFSet*)set;
#ifdef OF_HAVE_BLOCKS
/**
* \brief Executes a block for each object.
*
* \param block The block to execute for each object
*/
- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block;
/**
* \brief Returns a new set, only containing the objects for which the block
* returns YES.
*
* \param block A block which determines if the object should be in the new set
* \return A new, autoreleased OFSet
*/
- (OFSet*)filteredSetUsingBlock: (of_set_filter_block_t)block;
#endif
@end
#import "OFMutableSet.h"
|