Class PageRanges

  • All Implemented Interfaces:
    java.lang.Iterable<PageRange>, java.util.Collection<PageRange>, java.util.List<PageRange>

    public class PageRanges
    extends java.util.AbstractList<PageRange>
    A list of PageRanges
    Author:
    Michel Kraemer
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      PageRanges()
      Construct an empty list of page ranges
      PageRanges​(PageRange singleRange)
      Construct a list containing a single page range
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(PageRange pageRange)  
      PageRange get​(int index)  
      java.lang.String getLiteral()  
      java.lang.Integer getNumberOfPages()  
      java.lang.String getPageFirst()  
      boolean isMultiplePages()  
      PageRange remove​(int index)  
      PageRange set​(int index, PageRange element)  
      int size()  
      • Methods inherited from class java.util.AbstractList

        add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • Constructor Detail

      • PageRanges

        public PageRanges()
        Construct an empty list of page ranges
      • PageRanges

        public PageRanges​(PageRange singleRange)
        Construct a list containing a single page range
        Parameters:
        singleRange - the page range
    • Method Detail

      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<PageRange>
        Specified by:
        size in interface java.util.List<PageRange>
        Specified by:
        size in class java.util.AbstractCollection<PageRange>
      • get

        public PageRange get​(int index)
        Specified by:
        get in interface java.util.List<PageRange>
        Specified by:
        get in class java.util.AbstractList<PageRange>
      • set

        public PageRange set​(int index,
                             PageRange element)
        Specified by:
        set in interface java.util.List<PageRange>
        Overrides:
        set in class java.util.AbstractList<PageRange>
      • add

        public boolean add​(PageRange pageRange)
        Specified by:
        add in interface java.util.Collection<PageRange>
        Specified by:
        add in interface java.util.List<PageRange>
        Overrides:
        add in class java.util.AbstractList<PageRange>
      • remove

        public PageRange remove​(int index)
        Specified by:
        remove in interface java.util.List<PageRange>
        Overrides:
        remove in class java.util.AbstractList<PageRange>
      • getLiteral

        public java.lang.String getLiteral()
        Returns:
        the literal representation of this list of page ranges
      • getPageFirst

        public java.lang.String getPageFirst()
        Returns:
        the first page of all page ranges in this list
      • getNumberOfPages

        public java.lang.Integer getNumberOfPages()
        Returns:
        the sum of the number of pages of all page ranges in this list or null if the page ranges were unparsable and the sum could not be determined
      • isMultiplePages

        public boolean isMultiplePages()
        Returns:
        true if the page ranges in this list represent multiple pages