foxit.common.Range Class Reference
Inheritance diagram for foxit.common.Range:
foxit.common.Base

Public Types

enum  Filter { Filter.e_All = 0, Filter.e_Even = 1, Filter.e_Odd = 2 }
 Enumeration for range filter.
More...
 

Public Member Functions

 Range ()
 Constructor.

 
 Range (int index)
 Constructor, with a single index.
More...
 
 Range (int start_index, int end_index, Range.Filter filter)
 Constructor, with a specified index range.
More...
 
void AddSegment (int start_index, int end_index, Range.Filter filter)
 Add a new range segment. (Reverse ordering is legal.)
More...
 
void AddSingle (int index)
 Add an index as a new range segment.
More...
 
int GetSegmentCount ()
 Get the count of range segments.
More...
 
int GetSegmentEnd (int segment_index)
 Get the end index of a specified range segment.
More...
 
int GetSegmentStart (int segment_index)
 Get the start index of a specified range segment.
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.

Member Enumeration Documentation

◆ Filter

Enumeration for range filter.

Values of this enumeration should be used alone.

Enumerator
e_All 

All the indexes within a range will be used.

e_Even 

Only even numbers in a range will be used (discards odd numbers).

e_Odd 

Only odd numbers in a range will be used (discards even numbers).

Constructor & Destructor Documentation

◆ Range() [1/2]

foxit.common.Range.Range ( int  index)
inline

Constructor, with a single index.

Parameters
indexA single index.

◆ Range() [2/2]

foxit.common.Range.Range ( int  start_index,
int  end_index,
Range.Filter  filter 
)
inline

Constructor, with a specified index range.

Parameters
start_indexThe start index of a range segment.
end_indexThe end index of a range segment.
filterFilter type to decide which indexes of this range would be used. Please refer to e_XXX values and it should be one of these values.
Specially, when this value is e_Even or e_Odd, that means each even or odd number within the specified range segment will be treated as a single segment.

Member Function Documentation

◆ AddSegment()

void foxit.common.Range.AddSegment ( int  start_index,
int  end_index,
Range.Filter  filter 
)
inline

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

Parameters
start_indexThe start index of a new range segment.
end_indexThe end index of a new range segment.
filterFilter type to decide which indexes of this range would be used. Please refer to e_XXX values and it should be one of these values.
Specially, when this value is e_Even or 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 foxit.common.Range.AddSingle ( int  index)
inline

Add an index as a new range segment.

Parameters
indexAn index to be added as a new range segment.

◆ GetSegmentCount()

int foxit.common.Range.GetSegmentCount ( )
inline

Get the count of range segments.

Returns
The count of range segments.

◆ GetSegmentEnd()

int foxit.common.Range.GetSegmentEnd ( int  segment_index)
inline

Get the end index of a specified range segment.

Parameters
segment_indexThe 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 foxit.common.Range.GetSegmentStart ( int  segment_index)
inline

Get the start index of a specified range segment.

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

bool foxit.common.Range.IsEmpty ( )
inline

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 foxit.common.Range.RemoveAll ( )
inline

Remove all range segments.

Returns
None.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.