-
Notifications
You must be signed in to change notification settings - Fork 15
/
KLDateSort.h
62 lines (50 loc) · 1.64 KB
/
KLDateSort.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
//
// KLDateSort.h
// CalendarModule
//
// Created by Scott Montgomerie on 10-09-14.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
NSInteger KLDateSort(id date, id kldate, void *context);
@interface MroBinarySearch :NSObject {
NSArray *theArray;
}
- (MroBinarySearch*) initWithArray: (NSArray*) array;
- (int)count;
- (id)objectAtIndex:(NSUInteger)index;
-(NSInteger)binarySearch:(id)key;
/**
* @see MroBinarySearch::binarySearch:
* @see NSArray::sortedArrayUsingSelector:
*/
-(NSInteger)binarySearch:(id)key usingSelector:(SEL)comparator;
/**
* Binary search a part of an array.
*
* @param key nil returns -1
* @param comparator may be nil to use @selector(compare:)
* @param range
* @return found index.
*
* @see MroBinarySearch::binarySearch:
* @see NSArray::sortedArrayUsingSelector:
*/
-(NSInteger)binarySearch:(id)key usingSelector:(SEL)comparator inRange:(NSRange)range;
/**
* @see MroBinarySearch::binarySearch:
* @see NSArray::sortedArrayUsingFunction:context:
*/
-(NSInteger)binarySearch:(id)key usingFunction:(NSInteger (*)(id, id, void *))comparator context:(void *)context;
/**
* @see MroBinarySearch::binarySearch:
* @see NSArray::sortedArrayUsingFunction:context:
*/
-(NSInteger)binarySearch:(id)key usingFunction:(NSInteger (*)(id, id, void *))comparator context:(void *)context inRange:(NSRange)range;
/**
* @see MroBinarySearch::binarySearch:
* @see NSArray::sortedArrayUsingDescriptors:
*/
-(NSInteger)binarySearch:(id)key usingDescriptors:(NSArray *)sortDescriptors;
-(NSInteger)binarySearch:(id)key usingDescriptors:(NSArray *)sortDescriptors inRange:(NSRange)range;
@end