- Inherits From:
- EDIRCObject
- Conforms To:
- NSCopying
- NSCoding
- Declared In:
- EDRange.h
NSRange range;
range The corresponding NSRange.
Creating new range objectsRetrieving elements
- + rangeWithLocation:length:
- + rangeWithLocations::
- + rangeWithRangeValue:
- - initWithRangeValue:
- - initWithLocation:length:
- - initWithLocations::
"Contains" tests
- - location
- - length
- - endLocation
- - rangeValue
Comparing ranges
- - isLocationInRange:
- - containsRange:
Combining ranges
- - isEqualToRange:
- - compareLocation:
- - intersectionRange:
- - unionRange:
+ (id)rangeWithLocation:(unsigned int)loc length:(unsigned int)len
Creates and returns a range object with starting at loc and ranging len indices.
+ (id)rangeWithLocations:(unsigned int)startLoc :(unsigned int)endLoc
Creates and returns a range object with starting at startLoc and ending at endLoc.
+ (id)rangeWithRangeValue:(NSRange)aRangeValue
Creates and returns a range object for the NSRange aRangeValue.
- (NSComparisonResult)compareLocation:(EDRange *)otherRange
Returns NSOrderedAscending
if the start location of the receiver is greater than the one of otherRange, NSOrderedSame
if both have the same start location and NSOrderedDescending
otherwise.
- (BOOL)containsRange:(EDRange *)otherRange
Returns YES if otherRange is fully contained in the receiver, i.e. the union of both is equivalent to the receiver.
- (unsigned int)endLocation
Returns the end location of the range, i.e. startLocation + length - 1.
- (id)initWithLocation:(unsigned int)loc length:(unsigned int)len
Initialises a newly allocated range by setting its starting location to loc and its range to len.
- (id)initWithLocations:(unsigned int)startLoc :(unsigned int)endLoc
Initialises a newly allocated range by setting its starting location to startLoc and its end location to endLoc.
- (id)initWithRangeValue:(NSRange)aRangeValue
Initialises a newly allocated range with the NSRange aRangeValue.
- (EDRange *)intersectionRange:(EDRange *)otherRange
Returns a range object describing the intersection of the receiver and otherRange, i.e. a range containing the indices that exist in both ranges, nil
if the intersection is empty.
- (BOOL)isEqualToRange:(EDRange *)otherRange
Returns YES if otherRange is equivalent to the receiver, NO otherwise. When you know both objects are ranges, this method is a faster way to check equality than isEqual:.
- (BOOL)isLocationInRange:(unsigned int)index
Returns YES if index is in the range, i.e. startLocation <= index <= endLocation.
- (unsigned int)length
Returns the length of the range.
- (unsigned int)location
Returns the (start) location of the range.
- (NSRange)rangeValue
Returns the corresponding NSRange.
- (EDRange *)unionRange:(EDRange *)otherRange
Returns a range object describing the union of the receiver and otherRange, i.e. a range containing the indices in and between both ranges.