Class GridCell<T>


  • public class GridCell<T>
    extends Object
    Encapsulates a Grid point location and the objects at that point.
    Author:
    Nick Collier
    • Constructor Detail

      • GridCell

        public GridCell​(GridPoint pt,
                        Class<T> clazz)
        Creates a GridCell for the specified point.
        Parameters:
        pt - the location of the grid cell.
        clazz - the type of the objects the grid cell will hold
    • Method Detail

      • size

        public int size()
        Gets the number of object held by this GridCell.
        Returns:
        the number of object held by this GridCell.
      • items

        public Iterable<T> items()
        Gets an iterable of the objects held by this GridCell.
        Returns:
        an iterable of the objects held by this GridCell.
      • getPoint

        public GridPoint getPoint()
        Gets the location of this GridCell.
        Returns:
        the location of this GridCell.