Class Boundary2DWrapper

java.lang.Object
net.algart.matrices.scanning.Boundary2DScanner
net.algart.matrices.scanning.Boundary2DWrapper
Direct Known Subclasses:
Boundary2DProjectionMeasurer, Boundary2DSimpleMeasurer

public abstract class Boundary2DWrapper extends Boundary2DScanner

Abstract wrapper of a boundary scanner: special variant of Boundary2DScanner class, that redirects all methods to some parent scanner and, maybe, performs some additional actions.

All methods of this object and its inheritors call the same methods of the parent scanner and return their results. In addition, the nextBoundary() and goTo(long, long, net.algart.matrices.scanning.Boundary2DScanner.Side) methods of this class call resetCounters() method after calling the method of the parent scanner. An inheritor may add some other actions into any methods (usually into next() method).

Extending this class is a convenient way to process scanned boundaries without complication of the basic scanning loop (usually based on nextBoundary() and Boundary2DScanner.scanBoundary(net.algart.arrays.ArrayContext) calls). The simplest example is Boundary2DSimpleMeasurer class, that adds measuring operation to calling the parent next() method.

Author:
Daniel Alievsky