Package uk.ac.rdg.resc.edal.grid
Class GridCell2DImpl
- java.lang.Object
-
- uk.ac.rdg.resc.edal.grid.GridCell2DImpl
-
- All Implemented Interfaces:
Domain<HorizontalPosition>,GridCell2D,HorizontalCell
public final class GridCell2DImpl extends Object implements GridCell2D
Simple immutable implementation of a GridCell2D.- Author:
- Jon, Guy
-
-
Constructor Summary
Constructors Constructor Description GridCell2DImpl(GridCoordinates2D gridCoords, HorizontalPosition centre, Polygon footprint, HorizontalGrid parentGrid)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(HorizontalPosition position)HorizontalPositiongetCentre()PolygongetFootprint()GridCoordinates2DgetGridCoordinates()HorizontalGridgetParentDomain()StringtoString()
-
-
-
Constructor Detail
-
GridCell2DImpl
public GridCell2DImpl(GridCoordinates2D gridCoords, HorizontalPosition centre, Polygon footprint, HorizontalGrid parentGrid)
- Parameters:
gridCoords- The indices of this cell within its parent gridcentre- The centreHorizontalPositionof this grid cellfootprint- APolygonrepresenting the bounding box of this grid cell. Does not necessarily have to be a tight-bound around the cellparentGrid- TheHorizontalGridwhich thisGridCell2Dis part of
-
-
Method Detail
-
getGridCoordinates
public GridCoordinates2D getGridCoordinates()
- Specified by:
getGridCoordinatesin interfaceGridCell2D- Returns:
- the coordinates within the parent
HorizontalGrid
-
getCentre
public HorizontalPosition getCentre()
- Specified by:
getCentrein interfaceHorizontalCell- Returns:
- the centre of the cell in horizontal space
-
getFootprint
public Polygon getFootprint()
- Specified by:
getFootprintin interfaceHorizontalCell- Returns:
- the footprint of this cell in horizontal space.
-
contains
public boolean contains(HorizontalPosition position)
- Specified by:
containsin interfaceDomain<HorizontalPosition>- Returns:
- true if the given position is contained within this domain.
-
getParentDomain
public HorizontalGrid getParentDomain()
- Specified by:
getParentDomainin interfaceGridCell2D- Specified by:
getParentDomainin interfaceHorizontalCell- Returns:
- the grid of which this cell is a part
-
-