PageRenderTime 14ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/Frameworks/Foundation/objj.platform/CPSet.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 259 lines | 259 code | 0 blank | 0 comment | 0 complexity | 2593eb4b150c3ed2eab5b291f76808fa MD5 | raw file
  1i;10;CPObject.ji;9;CPArray.ji;10;CPNumber.ji;14;CPEnumerator.jc;7585;
  2var _1=objj_allocateClassPair(CPObject,"CPSet"),_2=_1.isa;
  3class_addIvars(_1,[new objj_ivar("_contents"),new objj_ivar("_count")]);
  4objj_registerClassPair(_1);
  5objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  6class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_3,_4){
  7with(_3){
  8if(_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPObject")},"init")){
  9_count=0;
 10_contents={};
 11}
 12return _3;
 13}
 14}),new objj_method(sel_getUid("initWithArray:"),function(_5,_6,_7){
 15with(_5){
 16if(_5=objj_msgSend(_5,"init")){
 17var _8=_7.length;
 18while(_8--){
 19objj_msgSend(_5,"addObject:",_7[_8]);
 20}
 21}
 22return _5;
 23}
 24}),new objj_method(sel_getUid("initWithObjects:count:"),function(_9,_a,_b,_c){
 25with(_9){
 26return objj_msgSend(_9,"initWithArray:",_b.splice(0,_c));
 27}
 28}),new objj_method(sel_getUid("initWithObjects:"),function(_d,_e,_f){
 29with(_d){
 30if(_d=objj_msgSend(_d,"init")){
 31var _10=arguments.length,i=2;
 32for(;i<_10&&(argument=arguments[i])!=nil;++i){
 33objj_msgSend(_d,"addObject:",argument);
 34}
 35}
 36return _d;
 37}
 38}),new objj_method(sel_getUid("initWithSet:"),function(_12,_13,_14){
 39with(_12){
 40return objj_msgSend(_12,"initWithSet:copyItems:",_14,NO);
 41}
 42}),new objj_method(sel_getUid("initWithSet:copyItems:"),function(_15,_16,_17,_18){
 43with(_15){
 44_15=objj_msgSend(_15,"init");
 45if(!_17){
 46return _15;
 47}
 48var _19=_17._contents;
 49for(var _1a in _19){
 50if(_19.hasOwnProperty(_1a)){
 51if(_18){
 52objj_msgSend(_15,"addObject:",objj_msgSend(_19[_1a],"copy"));
 53}else{
 54objj_msgSend(_15,"addObject:",_19[_1a]);
 55}
 56}
 57}
 58return _15;
 59}
 60}),new objj_method(sel_getUid("allObjects"),function(_1b,_1c){
 61with(_1b){
 62var _1d=[];
 63for(var _1e in _contents){
 64if(_contents.hasOwnProperty(_1e)){
 65_1d.push(_contents[_1e]);
 66}
 67}
 68return _1d;
 69}
 70}),new objj_method(sel_getUid("anyObject"),function(_1f,_20){
 71with(_1f){
 72for(var _21 in _contents){
 73if(_contents.hasOwnProperty(_21)){
 74return _contents[_21];
 75}
 76}
 77return nil;
 78}
 79}),new objj_method(sel_getUid("containsObject:"),function(_22,_23,_24){
 80with(_22){
 81if(_contents[objj_msgSend(_24,"hash")]&&objj_msgSend(_contents[objj_msgSend(_24,"hash")],"isEqual:",_24)){
 82return YES;
 83}
 84return NO;
 85}
 86}),new objj_method(sel_getUid("count"),function(_25,_26){
 87with(_25){
 88return _count;
 89}
 90}),new objj_method(sel_getUid("intersectsSet:"),function(_27,_28,set){
 91with(_27){
 92var _2a=objj_msgSend(set,"allObjects");
 93for(var i=_2a.length;i>0;i--){
 94if(objj_msgSend(_27,"containsObject:",_2a[i])){
 95return YES;
 96}
 97}
 98return NO;
 99}
100}),new objj_method(sel_getUid("isEqualToSet:"),function(_2c,_2d,set){
101with(_2c){
102return _2c===set||(objj_msgSend(_2c,"count")===objj_msgSend(set,"count")&&objj_msgSend(set,"isSubsetOfSet:",_2c));
103}
104}),new objj_method(sel_getUid("isSubsetOfSet:"),function(_2f,_30,set){
105with(_2f){
106var _32=objj_msgSend(_2f,"allObjects");
107for(var i=0;i<_32.length;i++){
108if(!objj_msgSend(set,"containsObject:",_32[i])){
109return NO;
110}
111}
112return YES;
113}
114}),new objj_method(sel_getUid("makeObjectsPerformSelector:"),function(_34,_35,_36){
115with(_34){
116objj_msgSend(_34,"makeObjectsPerformSelector:withObject:",_36,nil);
117}
118}),new objj_method(sel_getUid("makeObjectsPerformSelector:withObject:"),function(_37,_38,_39,_3a){
119with(_37){
120var _3b=objj_msgSend(_37,"allObjects");
121for(var i=0;i<_3b.length;i++){
122objj_msgSend(_3b[i],"performSelector:withObject:",_39,_3a);
123}
124}
125}),new objj_method(sel_getUid("member:"),function(_3d,_3e,_3f){
126with(_3d){
127if(objj_msgSend(_3d,"containsObject:",_3f)){
128return _3f;
129}
130return nil;
131}
132}),new objj_method(sel_getUid("objectEnumerator"),function(_40,_41){
133with(_40){
134return objj_msgSend(objj_msgSend(_40,"allObjects"),"objectEnumerator");
135}
136}),new objj_method(sel_getUid("initWithCapacity:"),function(_42,_43,_44){
137with(_42){
138_42=objj_msgSend(_42,"init");
139return _42;
140}
141}),new objj_method(sel_getUid("setSet:"),function(_45,_46,set){
142with(_45){
143objj_msgSend(_45,"removeAllObjects");
144objj_msgSend(_45,"addObjectsFromArray:",objj_msgSend(set,"allObjects"));
145}
146}),new objj_method(sel_getUid("addObject:"),function(_48,_49,_4a){
147with(_48){
148_contents[objj_msgSend(_4a,"hash")]=_4a;
149_count++;
150}
151}),new objj_method(sel_getUid("addObjectsFromArray:"),function(_4b,_4c,_4d){
152with(_4b){
153for(var i=0,_4f=_4d.length;i<_4f;i++){
154objj_msgSend(_4b,"addObject:",_4d[i]);
155}
156}
157}),new objj_method(sel_getUid("removeObject:"),function(_50,_51,_52){
158with(_50){
159if(objj_msgSend(_50,"containsObject:",_52)){
160delete _contents[objj_msgSend(_52,"hash")];
161_count--;
162}
163}
164}),new objj_method(sel_getUid("removeAllObjects"),function(_53,_54){
165with(_53){
166_contents={};
167_count=0;
168}
169}),new objj_method(sel_getUid("intersectSet:"),function(_55,_56,set){
170with(_55){
171var _58=objj_msgSend(_55,"allObjects");
172for(var i=0,_5a=_58.length;i<_5a;i++){
173if(!objj_msgSend(set,"containsObject:",_58[i])){
174objj_msgSend(_55,"removeObject:",_58[i]);
175}
176}
177}
178}),new objj_method(sel_getUid("minusSet:"),function(_5b,_5c,set){
179with(_5b){
180var _5e=objj_msgSend(set,"allObjects");
181for(var i=0;i<_5e.length;i++){
182if(objj_msgSend(_5b,"containsObject:",_5e[i])){
183objj_msgSend(_5b,"removeObject:",_5e[i]);
184}
185}
186}
187}),new objj_method(sel_getUid("unionSet:"),function(_60,_61,set){
188with(_60){
189var _63=objj_msgSend(set,"allObjects");
190for(var i=0,_65=_63.length;i<_65;i++){
191objj_msgSend(_60,"addObject:",_63[i]);
192}
193}
194})]);
195class_addMethods(_2,[new objj_method(sel_getUid("set"),function(_66,_67){
196with(_66){
197return objj_msgSend(objj_msgSend(_66,"alloc"),"init");
198}
199}),new objj_method(sel_getUid("setWithArray:"),function(_68,_69,_6a){
200with(_68){
201return objj_msgSend(objj_msgSend(_68,"alloc"),"initWithArray:",_6a);
202}
203}),new objj_method(sel_getUid("setWithObject:"),function(_6b,_6c,_6d){
204with(_6b){
205return objj_msgSend(objj_msgSend(_6b,"alloc"),"initWithArray:",[_6d]);
206}
207}),new objj_method(sel_getUid("setWithObjects:count:"),function(_6e,_6f,_70,_71){
208with(_6e){
209return objj_msgSend(objj_msgSend(_6e,"alloc"),"initWithObjects:count:",_70,_71);
210}
211}),new objj_method(sel_getUid("setWithObjects:"),function(_72,_73,_74){
212with(_72){
213var set=objj_msgSend(objj_msgSend(_72,"alloc"),"init"),_76=arguments.length,i=2;
214for(;i<_76&&((argument=arguments[i])!==nil);++i){
215objj_msgSend(set,"addObject:",argument);
216}
217return set;
218}
219}),new objj_method(sel_getUid("setWithSet:"),function(_78,_79,set){
220with(_78){
221return objj_msgSend(objj_msgSend(_78,"alloc"),"initWithSet:",set);
222}
223}),new objj_method(sel_getUid("setWithCapacity:"),function(_7b,_7c,_7d){
224with(_7b){
225return objj_msgSend(objj_msgSend(_7b,"alloc"),"initWithCapacity:",_7d);
226}
227})]);
228var _1=objj_getClass("CPSet");
229if(!_1){
230objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"CPSet\""));
231}
232var _2=_1.isa;
233class_addMethods(_1,[new objj_method(sel_getUid("copy"),function(_7e,_7f){
234with(_7e){
235return objj_msgSend(objj_msgSend(CPSet,"alloc"),"initWithSet:",_7e);
236}
237}),new objj_method(sel_getUid("mutableCopy"),function(_80,_81){
238with(_80){
239return objj_msgSend(_80,"copy");
240}
241})]);
242var _82="CPSetObjectsKey";
243var _1=objj_getClass("CPSet");
244if(!_1){
245objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"CPSet\""));
246}
247var _2=_1.isa;
248class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_83,_84,_85){
249with(_83){
250return objj_msgSend(_83,"initWithArray:",objj_msgSend(_85,"decodeObjectForKey:",_82));
251}
252}),new objj_method(sel_getUid("encodeWithCoder:"),function(_86,_87,_88){
253with(_86){
254objj_msgSend(_88,"encodeObject:forKey:",objj_msgSend(_86,"allObjects"),_82);
255}
256})]);
257var _1=objj_allocateClassPair(CPSet,"CPMutableSet"),_2=_1.isa;
258objj_registerClassPair(_1);
259objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));