forked from gnachman/iTerm2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IntervalMap.h
37 lines (30 loc) · 824 Bytes
/
IntervalMap.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
//
// IntervalMap.h
// iTerm
//
// Created by George Nachman on 12/8/11.
// Copyright (c) 2011 Georgetech. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface IntRange : NSObject {
@public
int min;
int size;
}
+ (IntRange *)rangeWithMin:(int)min limit:(int)limit;
+ (IntRange *)rangeWithMin:(int)min size:(int)size;
- (BOOL)isEqualToIntRange:(IntRange *)other;
- (BOOL)intersectsRange:(IntRange *)other;
- (IntRange *)intersectionWithRange:(IntRange *)other;
- (int)limit;
- (NSArray *)rangesAfterSubtractingRange:(IntRange *)other;
@end
@interface IntervalMap : NSObject {
NSMutableArray *elements_;
}
- (id)init;
- (void)dealloc;
- (void)setObject:(id)object forRange:(IntRange *)range;
- (void)incrementNumbersBy:(int)amount inRange:(IntRange *)range;
- (NSArray *)allValues;
@end