Rectangular integer area, i.e. hyperparallelepiped in multidimensional space with integer coordinates of vertices. All edges of the hyperparallelepiped are parallel to coordinate axes. In 1-dimensional case it is an equivalent of {@link IRange} class,in 2-dimensional case it is an analog of the standard java.awt.Rectangle class.
More precisely, the region, specified by this class, is defined by two n-dimensional points with integer coordinates ( {@link IPoint}), named the minimal vertex min and maximal vertex max, and consists of all such points (x0, x1, ..., xn−1), that:
min. {@link IPoint#coord(int) coord(0)} ≤ x0 ≤max. {@link IPoint#coord(int) coord(0)},
min. {@link IPoint#coord(int) coord(1)} ≤ x1 ≤max. {@link IPoint#coord(int) coord(1)},
...,
min. {@link IPoint#coord(int) coord(n-1)} ≤ xn−1 ≤max. {@link IPoint#coord(int) coord(n-1)}.
The min and max points are specified while creating an instance of this class and can be retrieved by {@link #min()} and {@link #max()} methods.
The coordinates of the minimal vertex min. {@link IPoint#coord(int) coord(i)}are never greater than the corresponding coordinates of the maximal vertex max. {@link IPoint#coord(int) coord(i)}, the coordinates of the minimal and maximal vertices 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, "max. {@link IPoint#coord(int) coord(i)}-min. {@link IPoint#coord(int) coord(i)}+1" expression, returned by {@link #size(int)} method, and also"min. {@link IPoint#coord(int) coord(i)}-1", "min. {@link IPoint#coord(int) coord(i)}-2" and "max. {@link IPoint#coord(int) coord(i)}+1" expressions are always calculated without overflow, and the {@link #range(int)} method is always possible to return an allowed range.
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 RectangularArea