/Frameworks/Foundation/objj.platform/CPArray.j

http://github.com/jfahrenkrug/MapKit-HelloWorld · Unknown · 625 lines · 625 code · 0 blank · 0 comment · 0 complexity · 488d76356deeb088e3a97c6624b6af28 MD5 · raw file

  1. i;10;CPObject.ji;9;CPRange.ji;14;CPEnumerator.ji;18;CPSortDescriptor.ji;13;CPException.jc;17789;
  2. var _1=objj_allocateClassPair(CPEnumerator,"_CPArrayEnumerator"),_2=_1.isa;
  3. class_addIvars(_1,[new objj_ivar("_array"),new objj_ivar("_index")]);
  4. objj_registerClassPair(_1);
  5. objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  6. class_addMethods(_1,[new objj_method(sel_getUid("initWithArray:"),function(_3,_4,_5){
  7. with(_3){
  8. _3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPEnumerator")},"init");
  9. if(_3){
  10. _array=_5;
  11. _index=-1;
  12. }
  13. return _3;
  14. }
  15. }),new objj_method(sel_getUid("nextObject"),function(_6,_7){
  16. with(_6){
  17. if(++_index>=objj_msgSend(_array,"count")){
  18. return nil;
  19. }
  20. return objj_msgSend(_array,"objectAtIndex:",_index);
  21. }
  22. })]);
  23. var _1=objj_allocateClassPair(CPEnumerator,"_CPReverseArrayEnumerator"),_2=_1.isa;
  24. class_addIvars(_1,[new objj_ivar("_array"),new objj_ivar("_index")]);
  25. objj_registerClassPair(_1);
  26. objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  27. class_addMethods(_1,[new objj_method(sel_getUid("initWithArray:"),function(_8,_9,_a){
  28. with(_8){
  29. _8=objj_msgSendSuper({receiver:_8,super_class:objj_getClass("CPEnumerator")},"init");
  30. if(_8){
  31. _array=_a;
  32. _index=objj_msgSend(_array,"count");
  33. }
  34. return _8;
  35. }
  36. }),new objj_method(sel_getUid("nextObject"),function(_b,_c){
  37. with(_b){
  38. if(--_index<0){
  39. return nil;
  40. }
  41. return objj_msgSend(_array,"objectAtIndex:",_index);
  42. }
  43. })]);
  44. var _1=objj_allocateClassPair(CPObject,"CPArray"),_2=_1.isa;
  45. objj_registerClassPair(_1);
  46. objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  47. class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_d,_e){
  48. with(_d){
  49. return _d;
  50. }
  51. }),new objj_method(sel_getUid("initWithArray:"),function(_f,_10,_11){
  52. with(_f){
  53. _f=objj_msgSendSuper({receiver:_f,super_class:objj_getClass("CPObject")},"init");
  54. if(_f){
  55. objj_msgSend(_f,"setArray:",_11);
  56. }
  57. return _f;
  58. }
  59. }),new objj_method(sel_getUid("initWithArray:copyItems:"),function(_12,_13,_14,_15){
  60. with(_12){
  61. if(!_15){
  62. return objj_msgSend(_12,"initWithArray:",_14);
  63. }
  64. _12=objj_msgSendSuper({receiver:_12,super_class:objj_getClass("CPObject")},"init");
  65. if(_12){
  66. var _16=0,_17=objj_msgSend(_14,"count");
  67. for(;_16<_17;++i){
  68. if(_14[i].isa){
  69. _12[i]=objj_msgSend(_14,"copy");
  70. }else{
  71. _12[i]=_14;
  72. }
  73. }
  74. }
  75. return _12;
  76. }
  77. }),new objj_method(sel_getUid("initWithObjects:"),function(_18,_19,_1a){
  78. with(_18){
  79. var i=2,_1c;
  80. for(;i<arguments.length&&(_1c=arguments[i])!=nil;++i){
  81. push(_1c);
  82. }
  83. return _18;
  84. }
  85. }),new objj_method(sel_getUid("initWithObjects:count:"),function(_1d,_1e,_1f,_20){
  86. with(_1d){
  87. _1d=objj_msgSendSuper({receiver:_1d,super_class:objj_getClass("CPObject")},"init");
  88. if(_1d){
  89. var _21=0;
  90. for(;_21<_20;++_21){
  91. push(_1f[_21]);
  92. }
  93. }
  94. return _1d;
  95. }
  96. }),new objj_method(sel_getUid("hash"),function(_22,_23){
  97. with(_22){
  98. if(_22.__address==nil){
  99. _22.__address=_objj_generateObjectHash();
  100. }
  101. return _22.__address;
  102. }
  103. }),new objj_method(sel_getUid("containsObject:"),function(_24,_25,_26){
  104. with(_24){
  105. return objj_msgSend(_24,"indexOfObject:",_26)!=CPNotFound;
  106. }
  107. }),new objj_method(sel_getUid("count"),function(_27,_28){
  108. with(_27){
  109. return length;
  110. }
  111. }),new objj_method(sel_getUid("indexOfObject:"),function(_29,_2a,_2b){
  112. with(_29){
  113. if(_2b===nil){
  114. return CPNotFound;
  115. }
  116. var i=0,_2d=length;
  117. if(_2b.isa){
  118. for(;i<_2d;++i){
  119. if(objj_msgSend(_29[i],"isEqual:",_2b)){
  120. return i;
  121. }
  122. }
  123. }else{
  124. if(_29.indexOf){
  125. return indexOf(_2b);
  126. }else{
  127. for(;i<_2d;++i){
  128. if(_29[i]==_2b){
  129. return i;
  130. }
  131. }
  132. }
  133. }
  134. return CPNotFound;
  135. }
  136. }),new objj_method(sel_getUid("indexOfObject:inRange:"),function(_2e,_2f,_30,_31){
  137. with(_2e){
  138. if(_30===nil){
  139. return CPNotFound;
  140. }
  141. var i=_31.location,_33=MIN(CPMaxRange(_31),length);
  142. if(_30.isa){
  143. for(;i<_33;++i){
  144. if(objj_msgSend(_2e[i],"isEqual:",_30)){
  145. return i;
  146. }
  147. }
  148. }else{
  149. for(;i<_33;++i){
  150. if(_2e[i]==_30){
  151. return i;
  152. }
  153. }
  154. }
  155. return CPNotFound;
  156. }
  157. }),new objj_method(sel_getUid("indexOfObjectIdenticalTo:"),function(_34,_35,_36){
  158. with(_34){
  159. if(_36===nil){
  160. return CPNotFound;
  161. }
  162. if(_34.indexOf){
  163. return indexOf(_36);
  164. }else{
  165. var _37=0,_38=length;
  166. for(;_37<_38;++_37){
  167. if(_34[_37]==_36){
  168. return _37;
  169. }
  170. }
  171. }
  172. return CPNotFound;
  173. }
  174. }),new objj_method(sel_getUid("indexOfObjectIdenticalTo:inRange:"),function(_39,_3a,_3b,_3c){
  175. with(_39){
  176. if(_3b===nil){
  177. return CPNotFound;
  178. }
  179. if(_39.indexOf){
  180. var _3d=indexOf(_3b,_3c.location);
  181. if(CPLocationInRange(_3d,_3c)){
  182. return _3d;
  183. }
  184. }else{
  185. var _3d=_3c.location,_3e=MIN(CPMaxRange(_3c),length);
  186. for(;_3d<_3e;++_3d){
  187. if(_39[_3d]==_3b){
  188. return _3d;
  189. }
  190. }
  191. }
  192. return CPNotFound;
  193. }
  194. }),new objj_method(sel_getUid("indexOfObject:sortedBySelector:"),function(_3f,_40,_41,_42){
  195. with(_3f){
  196. return objj_msgSend(_3f,"indexOfObject:sortedByFunction:",_41,function(lhs,rhs){
  197. objj_msgSend(lhs,_42,rhs);
  198. });
  199. }
  200. }),new objj_method(sel_getUid("indexOfObject:sortedByFunction:"),function(_45,_46,_47,_48){
  201. with(_45){
  202. return objj_msgSend(_45,"indexOfObject:sortedByFunction:context:",_47,_48,nil);
  203. }
  204. }),new objj_method(sel_getUid("indexOfObject:sortedByFunction:context:"),function(_49,_4a,_4b,_4c,_4d){
  205. with(_49){
  206. if(!_4c||_4b===undefined){
  207. return CPNotFound;
  208. }
  209. var mid,c,_50=0,_51=length-1;
  210. while(_50<=_51){
  211. mid=FLOOR((_50+_51)/2);
  212. c=_4c(_4b,_49[mid],_4d);
  213. if(c>0){
  214. _50=mid+1;
  215. }else{
  216. if(c<0){
  217. _51=mid-1;
  218. }else{
  219. while(mid<length-1&&_4c(_4b,_49[mid+1],_4d)==CPOrderedSame){
  220. mid++;
  221. }
  222. return mid;
  223. }
  224. }
  225. }
  226. return CPNotFound;
  227. }
  228. }),new objj_method(sel_getUid("indexOfObject:sortedByDescriptors:"),function(_52,_53,_54,_55){
  229. with(_52){
  230. objj_msgSend(_52,"indexOfObject:sortedByFunction:",_54,function(lhs,rhs){
  231. var i=0,_59=objj_msgSend(_55,"count"),_5a=CPOrderedSame;
  232. while(i<_59){
  233. if((_5a=objj_msgSend(_55[i++],"compareObject:withObject:",lhs,rhs))!=CPOrderedSame){
  234. return _5a;
  235. }
  236. }
  237. return _5a;
  238. });
  239. }
  240. }),new objj_method(sel_getUid("lastObject"),function(_5b,_5c){
  241. with(_5b){
  242. var _5d=objj_msgSend(_5b,"count");
  243. if(!_5d){
  244. return nil;
  245. }
  246. return _5b[_5d-1];
  247. }
  248. }),new objj_method(sel_getUid("objectAtIndex:"),function(_5e,_5f,_60){
  249. with(_5e){
  250. return _5e[_60];
  251. }
  252. }),new objj_method(sel_getUid("objectsAtIndexes:"),function(_61,_62,_63){
  253. with(_61){
  254. var _64=objj_msgSend(_63,"firstIndex"),_65=[];
  255. while(_64!=CPNotFound){
  256. objj_msgSend(_65,"addObject:",_61[_64]);
  257. _64=objj_msgSend(_63,"indexGreaterThanIndex:",_64);
  258. }
  259. return _65;
  260. }
  261. }),new objj_method(sel_getUid("objectEnumerator"),function(_66,_67){
  262. with(_66){
  263. return objj_msgSend(objj_msgSend(_CPArrayEnumerator,"alloc"),"initWithArray:",_66);
  264. }
  265. }),new objj_method(sel_getUid("reverseObjectEnumerator"),function(_68,_69){
  266. with(_68){
  267. return objj_msgSend(objj_msgSend(_CPReverseArrayEnumerator,"alloc"),"initWithArray:",_68);
  268. }
  269. }),new objj_method(sel_getUid("makeObjectsPerformSelector:"),function(_6a,_6b,_6c){
  270. with(_6a){
  271. if(!_6c){
  272. objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"makeObjectsPerformSelector: 'aSelector' can't be nil");
  273. }
  274. var _6d=0,_6e=length;
  275. for(;_6d<_6e;++_6d){
  276. objj_msgSend(_6a[_6d],_6c);
  277. }
  278. }
  279. }),new objj_method(sel_getUid("makeObjectsPerformSelector:withObject:"),function(_6f,_70,_71,_72){
  280. with(_6f){
  281. if(!_71){
  282. objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"makeObjectsPerformSelector:withObject 'aSelector' can't be nil");
  283. }
  284. var _73=0,_74=length;
  285. for(;_73<_74;++_73){
  286. objj_msgSend(_6f[_73],_71,_72);
  287. }
  288. }
  289. }),new objj_method(sel_getUid("firstObjectCommonWithArray:"),function(_75,_76,_77){
  290. with(_75){
  291. if(!objj_msgSend(_77,"count")||!objj_msgSend(_75,"count")){
  292. return nil;
  293. }
  294. var i=0,_79=objj_msgSend(_75,"count");
  295. for(;i<_79;++i){
  296. if(objj_msgSend(_77,"containsObject:",_75[i])){
  297. return _75[i];
  298. }
  299. }
  300. return nil;
  301. }
  302. }),new objj_method(sel_getUid("isEqualToArray:"),function(_7a,_7b,_7c){
  303. with(_7a){
  304. if(_7a===_7c){
  305. return YES;
  306. }
  307. if(length!=_7c.length){
  308. return NO;
  309. }
  310. var _7d=0,_7e=objj_msgSend(_7a,"count");
  311. for(;_7d<_7e;++_7d){
  312. var lhs=_7a[_7d],rhs=_7c[_7d];
  313. if(lhs!==rhs&&(!lhs.isa||!rhs.isa||!objj_msgSend(lhs,"isEqual:",rhs))){
  314. return NO;
  315. }
  316. }
  317. return YES;
  318. }
  319. }),new objj_method(sel_getUid("isEqual:"),function(_81,_82,_83){
  320. with(_81){
  321. if(_81===_83){
  322. return YES;
  323. }
  324. if(!objj_msgSend(_83,"isKindOfClass:",objj_msgSend(CPArray,"class"))){
  325. return NO;
  326. }
  327. return objj_msgSend(_81,"isEqualToArray:",_83);
  328. }
  329. }),new objj_method(sel_getUid("arrayByAddingObject:"),function(_84,_85,_86){
  330. with(_84){
  331. if(_86===nil||_86===undefined){
  332. objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"arrayByAddingObject: object can't be nil");
  333. }
  334. var _87=objj_msgSend(_84,"copy");
  335. _87.push(_86);
  336. return _87;
  337. }
  338. }),new objj_method(sel_getUid("arrayByAddingObjectsFromArray:"),function(_88,_89,_8a){
  339. with(_88){
  340. return slice(0).concat(_8a);
  341. }
  342. }),new objj_method(sel_getUid("subarrayWithRange:"),function(_8b,_8c,_8d){
  343. with(_8b){
  344. if(_8d.location<0||CPMaxRange(_8d)>length){
  345. objj_msgSend(CPException,"raise:reason:",CPRangeException,"subarrayWithRange: aRange out of bounds");
  346. }
  347. return slice(_8d.location,CPMaxRange(_8d));
  348. }
  349. }),new objj_method(sel_getUid("sortedArrayUsingDescriptors:"),function(_8e,_8f,_90){
  350. with(_8e){
  351. var _91=objj_msgSend(_8e,"copy");
  352. objj_msgSend(_91,"sortUsingDescriptors:",_90);
  353. return _91;
  354. }
  355. }),new objj_method(sel_getUid("sortedArrayUsingFunction:"),function(_92,_93,_94){
  356. with(_92){
  357. return objj_msgSend(_92,"sortedArrayUsingFunction:context:",_94,nil);
  358. }
  359. }),new objj_method(sel_getUid("sortedArrayUsingFunction:context:"),function(_95,_96,_97,_98){
  360. with(_95){
  361. var _99=objj_msgSend(_95,"copy");
  362. objj_msgSend(_99,"sortUsingFunction:context:",_97,_98);
  363. return _99;
  364. }
  365. }),new objj_method(sel_getUid("sortedArrayUsingSelector:"),function(_9a,_9b,_9c){
  366. with(_9a){
  367. var _9d=objj_msgSend(_9a,"copy");
  368. objj_msgSend(_9d,"sortUsingSelector:",_9c);
  369. return _9d;
  370. }
  371. }),new objj_method(sel_getUid("componentsJoinedByString:"),function(_9e,_9f,_a0){
  372. with(_9e){
  373. return join(_a0);
  374. }
  375. }),new objj_method(sel_getUid("description"),function(_a1,_a2){
  376. with(_a1){
  377. var i=0,_a4=objj_msgSend(_a1,"count"),_a5="(";
  378. for(;i<_a4;++i){
  379. if(_a1[i].isa){
  380. _a5+=objj_msgSend(_a1[i],"description");
  381. }else{
  382. _a5+=_a1[i];
  383. }
  384. if(i!=_a4-1){
  385. _a5+=", ";
  386. }
  387. }
  388. return _a5+")";
  389. }
  390. }),new objj_method(sel_getUid("pathsMatchingExtensions:"),function(_a6,_a7,_a8){
  391. with(_a6){
  392. var _a9=0,_aa=objj_msgSend(_a6,"count"),_ab=[];
  393. for(;_a9<_aa;++_a9){
  394. if(_a6[_a9].isa&&objj_msgSend(_a6[_a9],"isKindOfClass:",objj_msgSend(CPString,"class"))&&objj_msgSend(_a8,"containsObject:",objj_msgSend(_a6[_a9],"pathExtension"))){
  395. _ab.push(_a6[_a9]);
  396. }
  397. }
  398. return _ab;
  399. }
  400. }),new objj_method(sel_getUid("setValue:forKey:"),function(_ac,_ad,_ae,_af){
  401. with(_ac){
  402. var i=0,_b1=objj_msgSend(_ac,"count");
  403. for(;i<_b1;++i){
  404. objj_msgSend(_ac[i],"setValue:forKey:",_ae,_af);
  405. }
  406. }
  407. }),new objj_method(sel_getUid("valueForKey:"),function(_b2,_b3,_b4){
  408. with(_b2){
  409. var i=0,_b6=objj_msgSend(_b2,"count"),_b7=[];
  410. for(;i<_b6;++i){
  411. _b7.push(objj_msgSend(_b2[i],"valueForKey:",_b4));
  412. }
  413. return _b7;
  414. }
  415. }),new objj_method(sel_getUid("copy"),function(_b8,_b9){
  416. with(_b8){
  417. return slice(0);
  418. }
  419. })]);
  420. class_addMethods(_2,[new objj_method(sel_getUid("alloc"),function(_ba,_bb){
  421. with(_ba){
  422. return [];
  423. }
  424. }),new objj_method(sel_getUid("array"),function(_bc,_bd){
  425. with(_bc){
  426. return objj_msgSend(objj_msgSend(_bc,"alloc"),"init");
  427. }
  428. }),new objj_method(sel_getUid("arrayWithArray:"),function(_be,_bf,_c0){
  429. with(_be){
  430. return objj_msgSend(objj_msgSend(_be,"alloc"),"initWithArray:",_c0);
  431. }
  432. }),new objj_method(sel_getUid("arrayWithObject:"),function(_c1,_c2,_c3){
  433. with(_c1){
  434. return objj_msgSend(objj_msgSend(_c1,"alloc"),"initWithObjects:",_c3);
  435. }
  436. }),new objj_method(sel_getUid("arrayWithObjects:"),function(_c4,_c5,_c6){
  437. with(_c4){
  438. var i=2,_c8=objj_msgSend(objj_msgSend(_c4,"alloc"),"init"),_c9;
  439. for(;i<arguments.length&&(_c9=arguments[i])!=nil;++i){
  440. _c8.push(_c9);
  441. }
  442. return _c8;
  443. }
  444. }),new objj_method(sel_getUid("arrayWithObjects:count:"),function(_ca,_cb,_cc,_cd){
  445. with(_ca){
  446. return objj_msgSend(objj_msgSend(_ca,"alloc"),"initWithObjects:count:",_cc,_cd);
  447. }
  448. })]);
  449. var _1=objj_getClass("CPArray");
  450. if(!_1){
  451. objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"CPArray\""));
  452. }
  453. var _2=_1.isa;
  454. class_addMethods(_1,[new objj_method(sel_getUid("initWithCapacity:"),function(_ce,_cf,_d0){
  455. with(_ce){
  456. return _ce;
  457. }
  458. }),new objj_method(sel_getUid("addObject:"),function(_d1,_d2,_d3){
  459. with(_d1){
  460. push(_d3);
  461. }
  462. }),new objj_method(sel_getUid("addObjectsFromArray:"),function(_d4,_d5,_d6){
  463. with(_d4){
  464. splice.apply(_d4,[length,0].concat(_d6));
  465. }
  466. }),new objj_method(sel_getUid("insertObject:atIndex:"),function(_d7,_d8,_d9,_da){
  467. with(_d7){
  468. splice(_da,0,_d9);
  469. }
  470. }),new objj_method(sel_getUid("insertObjects:atIndexes:"),function(_db,_dc,_dd,_de){
  471. with(_db){
  472. var _df=objj_msgSend(_de,"count"),_e0=objj_msgSend(_dd,"count");
  473. if(_df!==_e0){
  474. objj_msgSend(CPException,"raise:reason:",CPRangeException,"the counts of the passed-in array ("+_e0+") and index set ("+_df+") must be identical.");
  475. }
  476. var _e1=objj_msgSend(_de,"lastIndex");
  477. if(_e1>=objj_msgSend(_db,"count")+_df){
  478. objj_msgSend(CPException,"raise:reason:",CPRangeException,"the last index ("+_e1+") must be less than the sum of the original count ("+objj_msgSend(_db,"count")+") and the insertion count ("+_df+").");
  479. }
  480. var _e2=0,_e3=objj_msgSend(_de,"firstIndex");
  481. for(;_e2<_e0;++_e2,_e3=objj_msgSend(_de,"indexGreaterThanIndex:",_e3)){
  482. objj_msgSend(_db,"insertObject:atIndex:",_dd[_e2],_e3);
  483. }
  484. }
  485. }),new objj_method(sel_getUid("replaceObjectAtIndex:withObject:"),function(_e4,_e5,_e6,_e7){
  486. with(_e4){
  487. _e4[_e6]=_e7;
  488. }
  489. }),new objj_method(sel_getUid("replaceObjectsAtIndexes:withObjects:"),function(_e8,_e9,_ea,_eb){
  490. with(_e8){
  491. var i=0,_ed=objj_msgSend(_ea,"firstIndex");
  492. while(_ed!=CPNotFound){
  493. objj_msgSend(_e8,"replaceObjectAtIndex:withObject:",_ed,_eb[i++]);
  494. _ed=objj_msgSend(_ea,"indexGreaterThanIndex:",_ed);
  495. }
  496. }
  497. }),new objj_method(sel_getUid("replaceObjectsInRange:withObjectsFromArray:range:"),function(_ee,_ef,_f0,_f1,_f2){
  498. with(_ee){
  499. if(!_f2.location&&_f2.length==objj_msgSend(_f1,"count")){
  500. objj_msgSend(_ee,"replaceObjectsInRange:withObjectsFromArray:",_f0,_f1);
  501. }else{
  502. splice.apply(_ee,[_f0.location,_f0.length].concat(objj_msgSend(_f1,"subarrayWithRange:",_f2)));
  503. }
  504. }
  505. }),new objj_method(sel_getUid("replaceObjectsInRange:withObjectsFromArray:"),function(_f3,_f4,_f5,_f6){
  506. with(_f3){
  507. splice.apply(_f3,[_f5.location,_f5.length].concat(_f6));
  508. }
  509. }),new objj_method(sel_getUid("setArray:"),function(_f7,_f8,_f9){
  510. with(_f7){
  511. if(_f7==_f9){
  512. return;
  513. }
  514. splice.apply(_f7,[0,length].concat(_f9));
  515. }
  516. }),new objj_method(sel_getUid("removeAllObjects"),function(_fa,_fb){
  517. with(_fa){
  518. splice(0,length);
  519. }
  520. }),new objj_method(sel_getUid("removeLastObject"),function(_fc,_fd){
  521. with(_fc){
  522. pop();
  523. }
  524. }),new objj_method(sel_getUid("removeObject:"),function(_fe,_ff,_100){
  525. with(_fe){
  526. objj_msgSend(_fe,"removeObject:inRange:",_100,CPMakeRange(0,length));
  527. }
  528. }),new objj_method(sel_getUid("removeObject:inRange:"),function(self,_cmd,_103,_104){
  529. with(self){
  530. var _105;
  531. while((_105=objj_msgSend(self,"indexOfObject:inRange:",_103,_104))!=CPNotFound){
  532. objj_msgSend(self,"removeObjectAtIndex:",_105);
  533. _104=CPIntersectionRange(CPMakeRange(_105,length-_105),_104);
  534. }
  535. }
  536. }),new objj_method(sel_getUid("removeObjectAtIndex:"),function(self,_cmd,_108){
  537. with(self){
  538. splice(_108,1);
  539. }
  540. }),new objj_method(sel_getUid("removeObjectsAtIndexes:"),function(self,_cmd,_10b){
  541. with(self){
  542. var _10c=objj_msgSend(_10b,"lastIndex");
  543. while(_10c!=CPNotFound){
  544. objj_msgSend(self,"removeObjectAtIndex:",_10c);
  545. _10c=objj_msgSend(_10b,"indexLessThanIndex:",_10c);
  546. }
  547. }
  548. }),new objj_method(sel_getUid("removeObjectIdenticalTo:"),function(self,_cmd,_10f){
  549. with(self){
  550. objj_msgSend(self,"removeObjectIdenticalTo:inRange:",_10f,CPMakeRange(0,length));
  551. }
  552. }),new objj_method(sel_getUid("removeObjectIdenticalTo:inRange:"),function(self,_cmd,_112,_113){
  553. with(self){
  554. var _114;
  555. while((_114=objj_msgSend(self,"indexOfObjectIdenticalTo:inRange:",_112,_113))!=CPNotFound){
  556. objj_msgSend(self,"removeObjectAtIndex:",_114);
  557. _113=CPIntersectionRange(CPMakeRange(_114,length-_114),_113);
  558. }
  559. }
  560. }),new objj_method(sel_getUid("removeObjectsInArray:"),function(self,_cmd,_117){
  561. with(self){
  562. var _118=0,_119=objj_msgSend(_117,"count");
  563. for(;_118<_119;++_118){
  564. objj_msgSend(self,"removeObject:",_117[_118]);
  565. }
  566. }
  567. }),new objj_method(sel_getUid("removeObjectsInRange:"),function(self,_cmd,_11c){
  568. with(self){
  569. splice(_11c.location,_11c.length);
  570. }
  571. }),new objj_method(sel_getUid("exchangeObjectAtIndex:withObjectAtIndex:"),function(self,_cmd,_11f,_120){
  572. with(self){
  573. var _121=self[_11f];
  574. self[_11f]=self[_120];
  575. self[_120]=_121;
  576. }
  577. }),new objj_method(sel_getUid("sortUsingDescriptors:"),function(self,_cmd,_124){
  578. with(self){
  579. sort(function(lhs,rhs){
  580. var i=0,_128=objj_msgSend(_124,"count"),_129=CPOrderedSame;
  581. while(i<_128){
  582. if((_129=objj_msgSend(_124[i++],"compareObject:withObject:",lhs,rhs))!=CPOrderedSame){
  583. return _129;
  584. }
  585. }
  586. return _129;
  587. });
  588. }
  589. }),new objj_method(sel_getUid("sortUsingFunction:context:"),function(self,_cmd,_12c,_12d){
  590. with(self){
  591. sort(function(lhs,rhs){
  592. return _12c(lhs,rhs,_12d);
  593. });
  594. }
  595. }),new objj_method(sel_getUid("sortUsingSelector:"),function(self,_cmd,_132){
  596. with(self){
  597. sort(function(lhs,rhs){
  598. return objj_msgSend(lhs,_132,rhs);
  599. });
  600. }
  601. })]);
  602. class_addMethods(_2,[new objj_method(sel_getUid("arrayWithCapacity:"),function(self,_cmd,_137){
  603. with(self){
  604. return objj_msgSend(objj_msgSend(self,"alloc"),"initWithCapacity:",_137);
  605. }
  606. })]);
  607. var _1=objj_getClass("CPArray");
  608. if(!_1){
  609. objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"CPArray\""));
  610. }
  611. var _2=_1.isa;
  612. class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(self,_cmd,_13a){
  613. with(self){
  614. return objj_msgSend(_13a,"decodeObjectForKey:","CP.objects");
  615. }
  616. }),new objj_method(sel_getUid("encodeWithCoder:"),function(self,_cmd,_13d){
  617. with(self){
  618. objj_msgSend(_13d,"_encodeArrayOfObjects:forKey:",self,"CP.objects");
  619. }
  620. })]);
  621. var _1=objj_allocateClassPair(CPArray,"CPMutableArray"),_2=_1.isa;
  622. objj_registerClassPair(_1);
  623. objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  624. Array.prototype.isa=CPArray;
  625. objj_msgSend(CPArray,"initialize");