Encapsulates one page range, which can have open or closed bounds. By default is “fully open” - it includes all existing pages. Page numbering starts from 1, not from 0.
Immutable struct, that encapsulates a page range, which is not related to any specific document, and can represent a page range for any document.
Creates a page range, that starts from the specified page number (inclusively) and continues until the specified page number (exclusively)
PageRange()
public PageRange()
AllPages
public static final PageRange AllPages
Represents all existing pages of a document. Default value.
getStartNumber()
public final int getStartNumber()
Inclusive start page number, from which this page range starts. If 1 - page range starts from the first page of a document
Returns:
int
getEndNumber()
public final int getEndNumber()
Exclusive end page number, until which this page range continues and on which is stops exclusively. If 0 - page range spreads until end of the document
Returns:
int
getCount()
public final int getCount()
Numbers of pages within range. If 0 - page range spreads until end of the document no matter how much pages it consists of
Returns:
int
isDefault()
public final boolean isDefault()
Indicates whether this instance represents a default “fully open” page range i.e. it consists all pages of a document
Returns:
boolean
equals(PageRange other)
public final boolean equals(PageRange other)
Detects whether this instance of PageRange is equal to specified
fromStartPageTillEndPage(int startPageNumber, int endPageNumber)
public static PageRange fromStartPageTillEndPage(int startPageNumber, int endPageNumber)
Creates a page range, that starts from the specified page number (inclusively) and continues until the specified page number (exclusively)
Parameters:
Parameter
Type
Description
startPageNumber
int
Page number, from which page range starts, inclusively. Page numbers are 1-based, so must be strictly bigger than zero
endPageNumber
int
Page number, until which page range continues, exclusively. Page numbers are 1-based, so must be strictly bigger than zero, and also must be strictly greater than startPageNumber