Class GridCellNgh<T>


  • public class GridCellNgh<T>
    extends Object
    Retrieves the MooreNeighborhood around a particular GridPoint. The neighborhood is represented as a List of GridCell-s.
    Author:
    Nick Collier
    • Field Detail

      • extent

        protected int[] extent
      • mins

        protected int[] mins
      • maxs

        protected int[] maxs
      • clazz

        protected Class<T> clazz
    • Constructor Detail

      • GridCellNgh

        public GridCellNgh​(Grid<? extends Object> grid,
                           GridPoint point,
                           Class<T> clazz,
                           int... extent)
        Creates a GridCellNgh using the specified grid, point, type and extent.
        Parameters:
        grid - the grid that contains the neighborhood
        point - the central point of the neighborhood
        clazz - the type of objects we want to get in the neighborhood. Objects not of this type will not be in the neighborhood list
        extent - the extent of the neighborhood in each dimension
    • Method Detail

      • getNeighborhood

        public List<GridCell<T>> getNeighborhood​(boolean includeCenter)
        Gets the neighborhood of GridCells.
        Parameters:
        includeCenter - if true then the center, i.e the point GridCell will also be returned.
        Returns:
        a list of GridCells that make up the neighborhood.