AlgART Home
net.algart.math.patterns

Interface RectangularPattern

• All Superinterfaces:
Pattern, QuickPointCountPattern, UniformGridPattern

public interface RectangularPattern
extends UniformGridPattern, QuickPointCountPattern

Interface, used by Pattern implementations to indicate that they are rectangular patterns, i.e. consist of all points of some uniform grid inside some hyperparallelepiped. (For 2D patterns it means a rectangle, for 1D pattern it means an interval.) This interface is a subinterface of UniformGridPattern: all rectangular patterns are also uniform-grid. See also the section "Rectangular patterns" in the comments to Pattern interface.

More precisely, a pattern, implementing this interface, is a non-empty set of all points x(k) = (x0(k), x1(k), ..., xn−1(k)) (n=Pattern.dimCount()), such that:

x0(k) = o0 + i0(k)d0
x1(k) = o1 + i1(k)d1
. . .
xn−1(k) = on−1 + in−1(k)dn−1,
minjij(k)maxj for all j=0,1,...,n−1,
where oj are coordinates of the origin of the grid, dj are steps of the grid, and the integer numbers minj / maxj are coordinates of two integer points, specified while creating the pattern. Moreover, these parameters (oj, dj, minj / maxj) are stored inside the object and can be quickly read at any time by UniformGridPattern.gridIndexMin(), UniformGridPattern.gridIndexMax() and similar methods — this condition is a requirement for all implementations of this interface.

Note: not only patterns, implementing this interface, can be such sets of points. In particular, you can construct an analogous set by Patterns.newPattern(net.algart.math.Point...) method, and it will not implement this interface. If a uniform-grid pattern does not implement this interface, you can still try to detect, whether it is really a rectangular parallelepiped, by UniformGridPattern.isActuallyRectangular() method.

If a pattern implements this interface, then there is a guarantee that the following methods work very quickly (O(1) or O(dimCount()) operations):

Also in such patterns there is a guarantee, that all these methods work successfully, i.e. without risk to throw TooManyPointsInPatternError or OutOfMemoryError.

If a pattern implements this interface, it never implements DirectPointSetPattern interface.

There is a guarantee, that the following methods (and, in this package, only they) create patterns, implementing this interface:

Since:
JDK 1.5
Version:
1.2
Author:
Daniel Alievsky