Foxit PDF SDK

Instance Methods | List of all members
FSRange Class Reference
Inheritance diagram for FSRange:

## Instance Methods
(void) | - addSegment:end_index:filter:
| Add a new range segment. (Reverse ordering is legal.) More...
(void) | - addSingle:
| Add an index as a new range segment. More...
(int) | - getSegmentCount
| Get the count of range segments. More...
(int) | - getSegmentEnd:
| Get the end index of a specified range segment. More...
(int) | - getSegmentStart:
| Get the start index of a specified range segment. More...
(id) | - init
| Constructor.
(id) | - initWithIndex:
| Constructor, with a single index. More...
(id) | - initWithOther:
| Constructor, with another range object. More...
(id) | - initWithStart_index:end_index:filter:
| Constructor, with a specified index range. More...
(BOOL) | - isEmpty
| Check whether current object is empty or not. More...
(void) | - removeAll
| Remove all range segments. More...

## Detailed Description

This class represents index range. Here, a range consists of one or more segments and each segment consists of one single index or a group of consecutive indexes.
For some special case, such as used in FSHeaderFooter, index values specified in this range represent page numbers directly instead of page indexes.

See also
  FSHeaderFooter

## Method Documentation

## ◆ addSegment:end_index:filter:()

- (void) addSegment: |  | (int) | start_index
end_index: |  | (int) | end_index
filter: |  | (FSRangeFilter) | filter

Add a new range segment. (Reverse ordering is legal.)

Parameters

  [in] | start_index | The start index of a new range segment.
  [in] | end_index | The end index of a new range segment.
  [in] | filter | Filter type to decide which indexes of this range would be used. Please refer to values starting from FSRangeAll and this should be one of these values. Default value: FSRangeAll. Specially, when this value is FSRangeEven or FSRangeOdd, that means each even or odd number within the specified range segment will be treated as a single segment.

Returns
  None.

## ◆ addSingle:()

- (void) addSingle: |  | (int) | index |

Add an index as a new range segment.

Parameters

  [in] | index | An index to be added as a new range segment.

## ◆ getSegmentCount()

- (int) getSegmentCount |  |  |

Get the count of range segments.

Returns
  The count of range segments.

## ◆ getSegmentEnd:()

- (int) getSegmentEnd: |  | (int) | segment_index |

Get the end index of a specified range segment.

Parameters

  [in] | segment_index | The segment index. Valid range: 0 to (count-1). count is returned by function FSRange::getSegmentCount.

Returns
  The end index of a specified range segment.

## ◆ getSegmentStart:()

- (int) getSegmentStart: |  | (int) | segment_index |

Get the start index of a specified range segment.

Parameters

  [in] | segment_index | The segment index. Valid range: 0 to (count-1). count is returned by function FSRange::getSegmentCount.

Returns
  The start index of a specified range segment.

## ◆ initWithIndex:()

- (id) initWithIndex: |  | (int) | index |

Constructor, with a single index.

Parameters

  [in] | index | A single index.

## ◆ initWithOther:()

- (id) initWithOther: |  | (FSRange*) | other |

Constructor, with another range object.

Parameters

  [in] | other | Another range object.

## ◆ initWithStart_index:end_index:filter:()

- (id) initWithStart_index: |  | (int) | start_index
end_index: |  | (int) | end_index
filter: |  | (FSRangeFilter) | filter

Constructor, with a specified index range.

Parameters

  [in] | start_index | The start index of a range segment.
  [in] | end_index | The end index of a range segment.
  [in] | filter | Filter type to decide which indexes of this range would be used. Please refer to values starting from FSRangeAll and this should be one of these values. Default value: FSRangeAll. Specially, when this value is FSRangeEven or FSRangeOdd, that means each even or odd number within the specified range segment will be treated as a single segment.

## ◆ isEmpty()

- (BOOL) isEmpty |  |  |

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  YES means current object is empty, while NO means not.

## ◆ removeAll()

- (void) removeAll |  |  |

Remove all range segments.

Returns
  None.