Foundation/CPRange.j File Reference
Go to the source code of this file.
Function Documentation
function CPCopyRange |
( |
aRange |
|
) |
|
Makes a copy of a CPRange.
- Parameters:
-
| aRange | the CPRange to copy CPRange |
- Returns:
- CPRange the copy of the range
Definition at line 41 of file CPRange.j.
function CPEmptyRange |
( |
aRange |
|
) |
|
Sets a range's length
to 0.
- Parameters:
-
| aRange | the range to empty CPRange |
- Returns:
- CPRange the empty range (same as the argument)
Definition at line 63 of file CPRange.j.
function CPEqualRanges |
( |
lhsRange |
, |
|
|
rhsRange |
| |
|
) |
| | |
Determines if two CPRanges are equal.
- Parameters:
-
| lhsRange | the first CPRange |
| rhsRange | the second CPRange |
- Returns:
- BOOL
YES
if the two CPRanges are equal.
Definition at line 85 of file CPRange.j.
function CPIntersectionRange |
( |
lhsRange |
, |
|
|
rhsRange |
| |
|
) |
| | |
Creates a new CPRange that spans the common range of two CPRanges
- Parameters:
-
| lhsRange | the first CPRange |
| rhsRange | the second CPRange CPRange |
- Returns:
- CPRange the new CPRange
Definition at line 123 of file CPRange.j.
function CPLocationInRange |
( |
aLocation |
, |
|
|
aRange |
| |
|
) |
| | |
Determines if a number is within a specified CPRange.
- Parameters:
-
| aLocation | the number to check |
| aRange | the CPRange to check within CPRange |
- Returns:
- BOOL
YES
if aLocation/code> is within the range
Definition at line 97 of file CPRange.j.
function CPMakeRange |
( |
location |
, |
|
|
length |
| |
|
) |
| | |
Makes a CPRange.
- Parameters:
-
| location | the location for new range |
| length | the length of the new range CPRange |
- Returns:
- CPRange the new range object
Definition at line 30 of file CPRange.j.
function CPMakeRangeCopy |
( |
aRange |
|
) |
|
Makes a copy of a CPRange.
- Parameters:
-
| aRange | the CPRange to copy CPRange |
- Returns:
- CPRange the copy of the range
Definition at line 52 of file CPRange.j.
function CPMaxRange |
( |
aRange |
|
) |
|
Finds the range maximum. (location + length
)
- Parameters:
-
| aRange | the range to calculate a maximum from CPRange |
- Returns:
- int the range maximum
Definition at line 74 of file CPRange.j.
function CPRangeFromString |
( |
aString |
|
) |
|
Creates a CPRange from the contents of a CPString.
- Parameters:
-
| aString | the string to create a CPRange from CPRange |
- Returns:
- CPRange the new range
Definition at line 161 of file CPRange.j.
function CPRangeInRange |
( |
lhsRange |
, |
|
|
rhsRange |
| |
|
) |
| | |
Checks if a range completely contains another range. In other words, if one range is the "super range" of another.
- Parameters:
-
| lhsRange | the containing range |
| rhsRange | the range we are testing to see if lhsRange contains it CPRange |
- Returns:
- BOOL whether or not lhsRange completely contains rhsRange
Definition at line 139 of file CPRange.j.
function CPStringFromRange |
( |
aRange |
|
) |
|
Returns a string describing a range.
- Parameters:
-
| aRange | the range to describe CPRange |
- Returns:
- CPString a describing string
Definition at line 150 of file CPRange.j.
function CPUnionRange |
( |
lhsRange |
, |
|
|
rhsRange |
| |
|
) |
| | |
Creates a new range with the minimum location
and a length
that extends to the maximum length
.
- Parameters:
-
| lhsRange | the first CPRange |
| rhsRange | the second CPRange CPRange |
- Returns:
- CPRange the new CPRange
Definition at line 110 of file CPRange.j.