Enum Class PageSelector

java.lang.Object
java.lang.Enum<PageSelector>
com.nsdev.lettergenerator.model.layout.PageSelector
All Implemented Interfaces:
Serializable, Comparable<PageSelector>, Constable

public enum PageSelector extends Enum<PageSelector>
Page selection for fixed elements and watermarks. Page indexes used by matchesPageIndex(int) are zero-based; a single-page document has only its first page.
  • Enum Constant Details

    • FIRST

      public static final PageSelector FIRST
      Only the first page, including a document consisting of a single page.
    • FOLLOWING

      public static final PageSelector FOLLOWING
      Every page after the first; selects nothing in a single-page document.
    • ALL

      public static final PageSelector ALL
      Every page, including the first.
  • Method Details

    • values

      public static PageSelector[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PageSelector valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • matchesPageIndex

      public boolean matchesPageIndex(int pageIndex)
      Tests this selection against a zero-based renderer page index.
      Parameters:
      pageIndex - zero for the first page, one for the second, and so on
      Returns:
      true when selected; false for every negative index
    • mayCoincideWith

      public boolean mayCoincideWith(PageSelector other)
      Tests whether two selections can address the same page. FIRST and FOLLOWING are disjoint; ALL can coincide with either. Fixed-element collision checks use this relation.
      Parameters:
      other - page selection to compare; callers should supply a nonnull selector
      Returns:
      true if either selector is ALL or both selectors are identical