Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
com.foxit.sdk.common.Range Class Reference
Inheritance diagram for com.foxit.sdk.common.Range:

## Public Member Functions
| Range ()
| Constructor.
| Range (int index)
| Constructor, with a single index. More...
| Range (int start_index, int end_index, int filter)
| Constructor, with a specified index range. More...
| Range (Range other)
| Constructor, with another range object. More...
void | addSegment (int start_index, int end_index, int filter)
| Add a new range segment. (Reverse ordering is legal.) More...
void | addSingle (int index)
| Add an index as a new range segment. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
int | getSegmentCount () throws com.foxit.sdk.PDFException
| Get the count of range segments. More...
int | getSegmentEnd (int segment_index) throws com.foxit.sdk.PDFException
| Get the end index of a specified range segment. More...
int | getSegmentStart (int segment_index) throws com.foxit.sdk.PDFException
| Get the start index of a specified range segment. More...
boolean | isEmpty ()
| Check whether current object is empty or not. More...
void | removeAll () throws com.foxit.sdk.PDFException
| Remove all range segments. More...

## Static Public Attributes
static final int | e_All = 0
| All the indexes within a range will be used.
static final int | e_Even = 1
| Only even numbers in a range will be used (discards odd numbers).
static final int | e_Odd = 2
| 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 com.foxit.sdk.pdf.HeaderFooter , index values specified in this range represent page numbers directly instead of page indexes.

See also
  com.foxit.sdk.pdf.HeaderFooter

## Constructor & Destructor Documentation

## ◆ Range() [1/3]

com.foxit.sdk.common.Range.Range | ( | int | index | ) |

Constructor, with a single index.

Parameters

  [in] | index | A single index.

## ◆ Range() [2/3]

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

## ◆ Range() [3/3]

com.foxit.sdk.common.Range.Range | ( | Range | other | ) |

Constructor, with another range object.

Parameters

  [in] | other | Another range object.

## Member Function Documentation

## ◆ addSegment()

void com.foxit.sdk.common.Range.addSegment | ( | int | start_index,
|  | int | end_index,
|  | int | 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 com.foxit.sdk.common.Range.e_All and this should be one of these values. Default value: com.foxit.sdk.common.Range.e_All . Specially, when this value is com.foxit.sdk.common.Range.e_Even or com.foxit.sdk.common.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()

void com.foxit.sdk.common.Range.addSingle | ( | int | index | ) |

Add an index as a new range segment.

Parameters

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

## ◆ delete()

synchronized void com.foxit.sdk.common.Range.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

Reimplemented from com.foxit.sdk.common.Base.

## ◆ getSegmentCount()

int com.foxit.sdk.common.Range.getSegmentCount | ( |  | ) | throws com.foxit.sdk.PDFException

Get the count of range segments.

Returns
  The count of range segments.

## ◆ getSegmentEnd()

int com.foxit.sdk.common.Range.getSegmentEnd | ( | int | segment_index | ) | throws com.foxit.sdk.PDFException

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()

int com.foxit.sdk.common.Range.getSegmentStart | ( | int | segment_index | ) | throws com.foxit.sdk.PDFException

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()

boolean com.foxit.sdk.common.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()

void com.foxit.sdk.common.Range.removeAll | ( |  | ) | throws com.foxit.sdk.PDFException

Remove all range segments.

Returns
  None.