Package com.snowbound.common.utils
Class PageRange
- java.lang.Object
-
- com.snowbound.common.utils.PageRange
-
public class PageRange extends java.lang.ObjectRepresents a range of page indices within a document. Indices start at0.
-
-
Constructor Summary
Constructors Constructor Description PageRange(int totalNumPages)Creates a new page range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PageRangeall()Select each page in order from beginning to end.int[]asIndices()Return the selected indices as an array.PageRangecomplex(java.lang.String complexString)Select indices as specified in the selection string.booleanisEveryPage()PageRangerange(int startIndex, int endIndex)Select all pages within the given range.PageRangesingle(int selectedIndex)Select a single page.java.lang.StringtoString()
-
-
-
Method Detail
-
all
public PageRange all()
Select each page in order from beginning to end.- Returns:
- This object again, for convenience.
-
single
public PageRange single(int selectedIndex)
Select a single page.- Parameters:
selectedIndex- The desired page index (0-based).- Returns:
- This object again, for convenience.
-
complex
public PageRange complex(java.lang.String complexString)
Select indices as specified in the selection string. For example:"1, 10, 3, 5 - 7, 2"will select page indices[0, 9, 2, 4, 5, 6, 1].- Parameters:
complexString- The selection string.- Returns:
- This object again, for convenience.
-
range
public PageRange range(int startIndex, int endIndex)
Select all pages within the given range.- Parameters:
startIndex- The index to start from.endIndex- The final index (inclusive).- Returns:
- This object again, for convenience.
-
asIndices
public int[] asIndices()
Return the selected indices as an array.- Returns:
int[]containing the selected indices in order.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isEveryPage
public boolean isEveryPage()
-
-