Package org.refcodes.graphical
Interface GridDimension
-
- All Superinterfaces:
GridHeightAccessor
,GridWidthAccessor
- All Known Subinterfaces:
GridDimension.GridDimensionProperty
,GridDimension.GridDimensionPropertyBuilder
,Raster
,Raster.RasterProperty
,Raster.RasterPropertyBuilder
- All Known Implementing Classes:
GridDimensionImpl
,GridDimensionImpl.GridDimensionPropertyBuilderImpl
,RasterImpl
,RasterImpl.RasterPropertyBuilderImpl
public interface GridDimension extends GridHeightAccessor, GridWidthAccessor
Provides an accessor for aGridDimension
property.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
GridDimension.GridDimensionBuilder<B extends GridDimension.GridDimensionBuilder<B>>
The Interface GridDimensionBuilder.static interface
GridDimension.GridDimensionMutator
The Interface GridDimensionMutator.static interface
GridDimension.GridDimensionProperty
The Interface GridDimensionProperty.static interface
GridDimension.GridDimensionPropertyBuilder
The Interface GridDimensionPropertyBuilder.-
Nested classes/interfaces inherited from interface org.refcodes.graphical.GridHeightAccessor
GridHeightAccessor.GridHeightBuilder<B extends GridHeightAccessor.GridHeightBuilder<B>>, GridHeightAccessor.GridHeightMutator, GridHeightAccessor.GridHeightProperty
-
Nested classes/interfaces inherited from interface org.refcodes.graphical.GridWidthAccessor
GridWidthAccessor.GridWidthBuilder<B extends GridWidthAccessor.GridWidthBuilder<B>>, GridWidthAccessor.GridWidthMutator, GridWidthAccessor.GridWidthProperty
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static boolean
equals(GridDimension aGridDimensionA, GridDimension aGridDimensionB)
Equals.default boolean
isInBounds(int aPositionX, int aPositionY)
Tests whether the given position is inside of the bounds of the grid.default boolean
isInBounds(Position aPosition)
Tests whether the given position is inside of the bounds of the grid.default boolean
isInHeight(int aPositionY)
Tests whether the given y-position is inside of the bounds of the grid's height.default boolean
isInWidth(int aPositionX)
Tests whether the given x-position is inside of the bounds of the grid's width.-
Methods inherited from interface org.refcodes.graphical.GridHeightAccessor
getGridHeight
-
Methods inherited from interface org.refcodes.graphical.GridWidthAccessor
getGridWidth
-
-
-
-
Method Detail
-
isInBounds
default boolean isInBounds(Position aPosition)
Tests whether the given position is inside of the bounds of the grid. The x and y coordinates must be greater than or equals to 0 and smaller than the grid width (x) and grid height (y).- Parameters:
aPosition
- The position for which to determine if it is in bounds.- Returns:
- True in case the given position is in bounds.
-
isInBounds
default boolean isInBounds(int aPositionX, int aPositionY)
Tests whether the given position is inside of the bounds of the grid. The x- and y-coordinates must be greater or equals to 0 and smaller than the grid width (x) and grid height (y).- Parameters:
aPositionX
- The x-position for which to determine if it is in bounds regarding the grid width.aPositionY
- The y-position for which to determine if it is in bounds regarding the grid height.- Returns:
- True in case the given position is in bounds.
-
isInWidth
default boolean isInWidth(int aPositionX)
Tests whether the given x-position is inside of the bounds of the grid's width. The x-coordinate must be greater than or equals to 0 and smaller than the grid width.- Parameters:
aPositionX
- The x-position for which to determine if it is in bounds regarding the grid width.- Returns:
- True in case the given x-position is in bounds.
-
isInHeight
default boolean isInHeight(int aPositionY)
Tests whether the given y-position is inside of the bounds of the grid's height. The y-coordinate must be greater than or equals to 0 and smaller than the grid height.- Parameters:
aPositionY
- The y-position for which to determine if it is in bounds regarding the grid height.- Returns:
- True in case the given y-position is in bounds.
-
equals
static boolean equals(GridDimension aGridDimensionA, GridDimension aGridDimensionB)
Equals.- Parameters:
aGridDimensionA
- the grid dimension AaGridDimensionB
- the grid dimension B- Returns:
- true, if successful
-
-