Package de.undercouch.citeproc.bibtex
Class PageRanges
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<PageRange>
-
- de.undercouch.citeproc.bibtex.PageRanges
-
public class PageRanges extends AbstractList<PageRange>
A list ofPageRanges- 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 rangesPageRanges(PageRange singleRange)Construct a list containing a single page range
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(PageRange pageRange)PageRangeget(int index)StringgetLiteral()IntegergetNumberOfPages()StringgetPageFirst()booleanisMultiplePages()PageRangeremove(int index)PageRangeset(int index, PageRange element)intsize()-
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.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:
sizein interfaceCollection<PageRange>- Specified by:
sizein interfaceList<PageRange>- Specified by:
sizein classAbstractCollection<PageRange>
-
get
public PageRange get(int index)
-
add
public boolean add(PageRange pageRange)
- Specified by:
addin interfaceCollection<PageRange>- Specified by:
addin interfaceList<PageRange>- Overrides:
addin classAbstractList<PageRange>
-
remove
public PageRange remove(int index)
-
getLiteral
public String getLiteral()
- Returns:
- the literal representation of this list of page ranges
-
getPageFirst
public String getPageFirst()
- Returns:
- the first page of all page ranges in this list
-
getNumberOfPages
public Integer getNumberOfPages()
- Returns:
- the sum of the number of pages of all page ranges in this list
or
nullif the page ranges were unparsable and the sum could not be determined
-
isMultiplePages
public boolean isMultiplePages()
- Returns:
trueif the page ranges in this list represent multiple pages
-
-