ns.apache.org/lang/api-2.4/org/apache/commons/lang/math/LongRange.html" id="dummy">org.apache.commons.lang.math.LongRange.
The minimum number ( {@link #min()}) is never greater than the maximum number ( {@link #max()}), both minimal and maximum numbers {@link #min()} and ({@link #max()}) are always in range -Long.MAX_VALUE+1..Long.MAX_VALUE-1, and their difference is always less than Long.MAX_VALUE. In other words, " {@link #max()}- {@link #min()}+1" expression, returned by {@link #size()} method, and also" {@link #min()}-1", " {@link #min()}-2" and " {@link #max()}+1" expressions are always calculated without overflow.
Please draw attention to the important effect of the requirement above. If a..b is an allowed range (a= {@link #min()}, b= {@link #max()}), then 0..b−a and a−b..0 are also allowed ranges. Really, they have the same difference {@link #max()}- {@link #min()}=b−a=diff, and so far as this difference diff<Long.MAX_VALUE, both new bounds b−a=diff and a−b=−diff are also inside the required range -Long.MAX_VALUE+1..Long.MAX_VALUE-1.
This class is immutable and thread-safe: there are no ways to modify settings of the created instance.
AlgART Laboratory 2007–2014
@author Daniel Alievsky
@version 1.2
@since JDK 1.5
@see Range