org.sejda.model.pdf.page
Class PageRange

java.lang.Object
  extended by org.sejda.model.pdf.page.PageRange
All Implemented Interfaces:
PagesSelection

@EndGreaterThenOrEqualToStart
public class PageRange
extends Object
implements PagesSelection

Model for range of pages.

Author:
Andrea Vacondio

Constructor Summary
PageRange(int start)
          Creates a page range that starts at the given page and ends when the document ends.
PageRange(int start, int end)
          Creates a page range that goes from start to end (comprehended).
 
Method Summary
 boolean equals(Object other)
           
 int getEnd()
           
 SortedSet<Integer> getPages(int totalNumberOfPage)
           
 int getStart()
           
 int hashCode()
           
 boolean intersects(PageRange range)
           
 boolean isUnbounded()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PageRange

public PageRange(int start,
                 int end)
Creates a page range that goes from start to end (comprehended).

Parameters:
start -
end -

PageRange

public PageRange(int start)
Creates a page range that starts at the given page and ends when the document ends.

Parameters:
start -
Method Detail

getStart

public int getStart()

getEnd

public int getEnd()

isUnbounded

public boolean isUnbounded()
Returns:
true of this page range has a start but not an end.

intersects

public boolean intersects(PageRange range)
Parameters:
range -
Returns:
true if the input range intersect this PageRange instance.

getPages

public SortedSet<Integer> getPages(int totalNumberOfPage)
Specified by:
getPages in interface PagesSelection
Parameters:
totalNumberOfPage - the number of pages of the document (upper limit).
Returns:
the selected set of pages ordered using their natural ordering.
See Also:
PagesSelection.getPages(int)

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object


Copyright © 2013 sejda. All Rights Reserved.