Foxit PDF RDK

Public Member Functions | Static Public Attributes | List of all members
Range Class Reference
Inheritance diagram for Range:

## Public Member Functions
| AddSegment (start_index, end_index, filter)
| Add a new range segment. (Reverse ordering is legal.) More...
| AddSingle (index)
| Add an index as a new range segment. More...
| constructor ()
| Constructor.
| constructor (index)
| Constructor, with a single index. More...
| constructor (start_index, end_index, filter)
| Constructor, with a specified index range. More...
| GetSegmentCount ()
| Get the count of range segments. More...
| GetSegmentEnd (segment_index)
| Get the end index of a specified range segment. More...
| GetSegmentStart (segment_index)
| Get the start index of a specified range segment. More...
| IsEmpty ()
| Check whether current object is empty or not. More...
| RemoveAll ()
| Remove all range segments. More...
Public Member Functions inherited from NativeObjectWrapper
| constructor (r)
| GetPointerAsNumber ()

## Static Public Attributes
static | e_All
| Enumeration for range filter. More...
static | e_Even
| Only even numbers in a range will be used (discards odd numbers).
static | e_Odd
| Only odd numbers in a range will be used (discards even numbers).

## 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 HeaderFooter, index values specified in this range represent page numbers directly instead of page indexes.

See also
  HeaderFooter

Examples
  /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.

## Member Function Documentation

## ◆ AddSegment()

Range.AddSegment | ( | start_index | ,
|  | end_index | ,
|  | 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 Range.e_All and this should be one of these values. Default value: Range.e_All. Specially, when this value is Range.e_Even or Range.e_Odd, that means each even or odd number within the specified range segment will be treated as a single segment.

Returns
  None.

## ◆ AddSingle()

Range.AddSingle | ( | index |  | ) |

Add an index as a new range segment.

Parameters

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

## ◆ constructor() [1/2]

Range.constructor | ( | index |  | ) |

Constructor, with a single index.

Parameters

  [in] | index | A single index.

## ◆ constructor() [2/2]

Range.constructor | ( | start_index | ,
|  | end_index | ,
|  | 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 Range.e_All and this should be one of these values. Default value: Range.e_All. Specially, when this value is Range.e_Even or Range.e_Odd, that means each even or odd number within the specified range segment will be treated as a single segment.

## ◆ GetSegmentCount()

Range.GetSegmentCount | ( |  | ) |

Get the count of range segments.

Returns
  The count of range segments.

## ◆ GetSegmentEnd()

Range.GetSegmentEnd | ( | 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 Range.GetSegmentCount.

Returns
  The end index of a specified range segment.

## ◆ GetSegmentStart()

Range.GetSegmentStart | ( | 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 Range.GetSegmentCount.

Returns
  The start index of a specified range segment.

## ◆ IsEmpty()

Range.IsEmpty | ( |  | ) |

Check whether current object is empty or not.

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

Returns
  true means current object is empty, while false means not.

## ◆ RemoveAll()

Range.RemoveAll | ( |  | ) |

Remove all range segments.

Returns
  None.

## Member Data Documentation

## ◆ e_All

Range.e_All
| static

Enumeration for range filter.

Values of this enumeration should be used alone.

All the indexes within a range will be used.