Interface ConnectedObjectScanner.ElementVisitor

All Known Implementing Classes:
ConnectedObjectScanner.MaskElementCounter
Enclosing class:
ConnectedObjectScanner
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ConnectedObjectScanner.ElementVisitor

Visitor of matrix elements. Used by ConnectedObjectScanner class.

  • Method Details

    • visit

      void visit(long[] coordinatesInMatrix, long indexInArray)
      Method, called by ConnectedObjectScanner.clear(ArrayContext, ConnectedObjectScanner.ElementVisitor, long[], boolean) for every visited unit element of the scanned matrix.

      Important: coordinatesInMatrix argument can be null here! So, if you need to know the coordinates, you must check this argument and use Matrix.coordinates(long, long[]) method (or equivalent code) when it is null.

      If coordinatesInMatrix is not null, this method may modify elements of the passed coordinatesInMatrix: it will not affect to the behavior of the scanning algorithms.

      Parameters:
      coordinatesInMatrix - the coordinates of the element in the bit matrix or, maybe, null.
      indexInArray - the index of this element in the underlying array.