Archived
1
This repository has been archived on 2022-08-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
mathpad/MathPad/MPRange.h
2014-04-21 18:17:56 +02:00

39 lines
970 B
Objective-C

//
// MPRange.h
// MathPad
//
// Created by Kim Wittenburg on 18.04.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
@interface MPRange : NSObject <NSCopying, NSCoding>
#pragma mark Creation Methods
- (instancetype)init;
- (instancetype)initWithLocation:(NSIndexPath *)location
length:(NSUInteger)length;
- (instancetype)initWithRange:(NSRange)aRange;
+ (instancetype)emptyRange;
+ (instancetype)rangeWithLocation:(NSIndexPath *)location
length:(NSUInteger)length;
+ (instancetype)rangeWithRange:(NSRange)aRange;
#pragma mark Properties
@property (nonatomic, strong) NSIndexPath *location;
@property (nonatomic) NSUInteger length;
- (NSIndexPath *)maxRange;
- (NSRange)rangeAtLastIndex;
#pragma mark Working with Ranges
- (BOOL)containsRange:(MPRange *)aRange;
- (BOOL)containsLocation:(NSIndexPath *)location;
- (BOOL)isEqual:(id)object;
- (BOOL)isEqualToRange:(MPRange *)aRange;
@end