de.dante.extex.backend.documentWriter.util
Class PageManager

java.lang.Object
  extended byde.dante.extex.backend.documentWriter.util.PageManager

public class PageManager
extends java.lang.Object

This class is a validator for page numbers.

Version:
$Revision: 1.2 $
Author:
Gerd Neugebauer

Constructor Summary
PageManager()
          Creates a new object.
 
Method Summary
 void addPages(java.lang.CharSequence spec)
          Add some pages to be accepted.
 boolean isSelected(int page)
          Check whether the given page number is in a selected range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageManager

public PageManager()
Creates a new object.

Method Detail

addPages

public void addPages(java.lang.CharSequence spec)
              throws java.lang.IllegalArgumentException
Add some pages to be accepted. The specification is a comma separated list of single pages or ranges of pages.

Examples

  2
  2-5
  -12
  12-
  2-4,7-12
  2-4,12,28-
 

Parameters:
spec - the comma separated list of page ranges
Throws:
java.lang.IllegalArgumentException - in case of a parse error

isSelected

public boolean isSelected(int page)
Check whether the given page number is in a selected range.

Parameters:
page - the page number to check
Returns:
true iff the page is in a selected range