Returns a set of all points of this pattern.
The result of this method is immutable (Collections.unmodifiableSet). Moreover, the result is always the same for different calls of this method for the same instance — there are no ways to change it, in particular, via any custom methods of the implementation class (it is a conclusion from the common requirement, that all implementations of this interface must be immutable).
The returned set is always non-empty, and the number of its elements is always equal to {@link #pointCount()}.
Warning! This method can work slowly for some forms of large patterns. In these cases, this method can also throw {@link TooManyPointsInPatternError}or OutOfMemoryError. This method surely fails (throws one of these exception), if the total number of points {@link #pointCount()}>Integer.MAX_VALUE, because Java Set object cannot contain more than Integer.MAX_VALUE elements.
For example, implementations of the {@link RectangularPattern rectangular patterns}allow to successfully define a very large 3D parallelepiped n x n x n. Fur such pattern, this method will require a lot of memory for n=1000 and will fail (probably with {@link TooManyPointsInPatternError}) for n=2000 (20003>Integer.MAX_VALUE).
There is a guarantee, that if this object implements {@link DirectPointSetPattern} interface,then this method requires not greater than O(N) operations and memory (N= {@link #pointCount() pointCount()}) and never throws {@link TooManyPointsInPatternError}.
Note: this method works very quickly (O(1) operations) in {@link SimplePattern} class.
@return all points of this pattern.
@throws TooManyPointsInPatternError if the number of points is greater than Integer.MAX_VALUE or,in some rare situations, is near this limit (OutOfMemoryError can be also thrown instead of this exception).