# HG changeset patch # User Robert Casties # Date 1517424589 -3600 # Node ID 1f51277a03573be8442f0d2665888d410c5e9775 # Parent 699244b75ad3fd07bd7090262f410ffa78b213ad Documentation for NumRange. diff -r 699244b75ad3 -r 1f51277a0357 common/src/main/java/digilib/util/NumRange.java --- a/common/src/main/java/digilib/util/NumRange.java Tue Dec 05 19:14:55 2017 +0100 +++ b/common/src/main/java/digilib/util/NumRange.java Wed Jan 31 19:49:49 2018 +0100 @@ -29,6 +29,17 @@ import java.util.List; /** + * Class that parses String with intervals into Iterable sequence of integers. + *

+ * + * Intervals are separated by comma ','. + * An interval is a range represented by two numbers and a hyphen + * e.g. "3-6". If the second number is omitted the interval goes to maxnum. + * An interval can also consist of a single number e.g. "7". + *

+ * + * Valid NumRanges: "1-10,13-20", "3,5,9", "1-". + * * @author casties * */ @@ -70,8 +81,7 @@ String intervals[] = pages.split(","); - // convert the page-interval-strings into a list containing every single - // page + // convert the page-interval-strings into a list containing every single page for (String interval : intervals) { if (interval.contains("-")) { String nums[] = interval.split("-");