26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
-
+
-
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
|
Class isa;
} placeholder;
@interface OFMutableDictionary_placeholder: OFDictionary
@end
@implementation OFMutableDictionary_placeholder
- init
- (instancetype)init
{
return (id)[[OFMutableDictionary_hashtable alloc] init];
}
- initWithDictionary: (OFDictionary *)dictionary
- (instancetype)initWithDictionary: (OFDictionary *)dictionary
{
return (id)[[OFMutableDictionary_hashtable alloc]
initWithDictionary: dictionary];
}
- initWithObject: (id)object
forKey: (id)key
- (instancetype)initWithObject: (id)object
forKey: (id)key
{
return (id)[[OFMutableDictionary_hashtable alloc] initWithObject: object
forKey: key];
}
- initWithObjects: (OFArray *)objects
forKeys: (OFArray *)keys
- (instancetype)initWithObjects: (OFArray *)objects
forKeys: (OFArray *)keys
{
return (id)[[OFMutableDictionary_hashtable alloc]
initWithObjects: objects
forKeys: keys];
}
- initWithObjects: (id const *)objects
forKeys: (id const *)keys
count: (size_t)count
- (instancetype)initWithObjects: (id const *)objects
forKeys: (id const *)keys
count: (size_t)count
{
return (id)[[OFMutableDictionary_hashtable alloc]
initWithObjects: objects
forKeys: keys
count: count];
}
- initWithKeysAndObjects: (id)firstKey, ...
- (instancetype)initWithKeysAndObjects: (id)firstKey, ...
{
id ret;
va_list arguments;
va_start(arguments, firstKey);
ret = (id)[[OFMutableDictionary_hashtable alloc]
initWithKey: firstKey
arguments: arguments];
va_end(arguments);
return ret;
}
- initWithKey: (id)firstKey
arguments: (va_list)arguments
- (instancetype)initWithKey: (id)firstKey
arguments: (va_list)arguments
{
return (id)[[OFMutableDictionary_hashtable alloc]
initWithKey: firstKey
arguments: arguments];
}
- initWithSerialization: (OFXMLElement *)element
- (instancetype)initWithSerialization: (OFXMLElement *)element
{
return (id)[[OFMutableDictionary_hashtable alloc]
initWithSerialization: element];
}
- initWithCapacity: (size_t)capacity
- (instancetype)initWithCapacity: (size_t)capacity
{
return (id)[[OFMutableDictionary_hashtable alloc]
initWithCapacity: capacity];
}
- retain
- (instancetype)retain
{
return self;
}
- autorelease
- (instancetype)autorelease
{
return self;
}
- (void)release
{
}
|
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
-
+
-
+
-
+
|
@implementation OFMutableDictionary
+ (void)initialize
{
if (self == [OFMutableDictionary class])
placeholder.isa = [OFMutableDictionary_placeholder class];
}
+ alloc
+ (instancetype)alloc
{
if (self == [OFMutableDictionary class])
return (id)&placeholder;
return [super alloc];
}
+ (instancetype)dictionaryWithCapacity: (size_t)capacity
{
return [[[self alloc] initWithCapacity: capacity] autorelease];
}
- init
- (instancetype)init
{
if (object_getClass(self) == [OFMutableDictionary class]) {
@try {
[self doesNotRecognizeSelector: _cmd];
} @catch (id e) {
[self release];
@throw e;
}
abort();
}
return [super init];
}
- initWithCapacity: (size_t)capacity
- (instancetype)initWithCapacity: (size_t)capacity
{
OF_INVALID_INIT_METHOD
}
- (void)setObject: (id)object
forKey: (id)key
{
|
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
-
+
|
for (id key in [self allKeys])
[self removeObjectForKey: key];
objc_autoreleasePoolPop(pool);
}
- copy
- (id)copy
{
return [[OFDictionary alloc] initWithDictionary: self];
}
- (void)addEntriesFromDictionary: (OFDictionary *)dictionary
{
void *pool = objc_autoreleasePoolPush();
|