Class GridCellElement<P extends GISPrimitive>

    • Constructor Detail

      • GridCellElement

        GridCellElement​(P element)
        Constructor.
        Parameters:
        element - the element.
    • Method Detail

      • addCellLink

        public boolean addCellLink​(GridCell<P> cell)
        Add a reference from this element to a cell that is containing this element.
        Parameters:
        cell - the grid cell.
        Returns:
        true if the added cell is the reference; false if the added cell is not the reference.
      • removeCellLink

        public boolean removeCellLink​(GridCell<P> cell)
        Add a reference from this element to a cell that is containing this element.
        Parameters:
        cell - the grid cell.
        Returns:
        true if the removed cell is the reference; false if the removed cell is not the reference.
      • consumeCells

        public List<GridCell<P>> consumeCells()
        Replies the cell on which the given element is located. The cell links were removed from the element.
        Returns:
        a copy of the cells.
      • isReferenceCell

        @Pure
        public boolean isReferenceCell​(GridCell<P> cell)
        Replies if the specified cell is the reference cell for the element. The reference cell is the cell where the element is supported to be attached when it is supposed by be inside only one cell.
        Parameters:
        cell - is the cell to test
        Returns:
        true if the specified cell is the reference cell; false otherwise.
      • equals

        @Pure
        public boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • hashCode

        @Pure
        public int hashCode()
        Overrides:
        hashCode in class Object
      • get

        @Pure
        public P get()
        Replies the element.
        Returns:
        the element.