- java.lang.Object
-
- org.refcodes.graphical.RectangleImpl
-
- All Implemented Interfaces:
Dimension
,HeightAccessor
,Position
,PosXAccessor
,PosYAccessor
,Rectangle
,WidthAccessor
public class RectangleImpl extends Object implements Rectangle
The classRectangleImpl
implements theRectangle
interface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.graphical.Dimension
Dimension.DimensionBuilder<B extends Dimension.DimensionBuilder<B>>, Dimension.DimensionMutator, Dimension.DimensionProperty
-
Nested classes/interfaces inherited from interface org.refcodes.graphical.HeightAccessor
HeightAccessor.HeightBuilder<B extends HeightAccessor.HeightBuilder<B>>, HeightAccessor.HeightMutator, HeightAccessor.HeightProperty
-
Nested classes/interfaces inherited from interface org.refcodes.graphical.Position
Position.PositionBuilder<B extends Position.PositionBuilder<B>>, Position.PositionMutator, Position.PositionProperty
-
Nested classes/interfaces inherited from interface org.refcodes.graphical.PosXAccessor
PosXAccessor.PosXBuilder<B extends PosXAccessor.PosXBuilder<B>>, PosXAccessor.PosXMutator, PosXAccessor.PosXProperty
-
Nested classes/interfaces inherited from interface org.refcodes.graphical.PosYAccessor
PosYAccessor.PosYBuilder<B extends PosYAccessor.PosYBuilder<B>>, PosYAccessor.PosYMutator, PosYAccessor.PosYProperty
-
Nested classes/interfaces inherited from interface org.refcodes.graphical.Rectangle
Rectangle.RectangleBuilder<B extends Rectangle.RectangleBuilder<B>>, Rectangle.RectangleMutator, Rectangle.RectangleProperty
-
Nested classes/interfaces inherited from interface org.refcodes.graphical.WidthAccessor
WidthAccessor.WidthBuilder<B extends WidthAccessor.WidthBuilder<B>>, WidthAccessor.WidthMutator, WidthAccessor.WidthProperty
-
-
Constructor Summary
Constructors Constructor Description RectangleImpl(int aPositionX, int aPositionY, int aWidth, int aHeight)
Constructs aRectangle
with the given metrics.RectangleImpl(Position aPosition, Dimension aDimension)
Constructs aRectangle
with the given metrics.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
getHeight()
Retrieves the height from the height property.int
getPositionX()
Retrieves the X position from the X position property.int
getPositionY()
Retrieves the Y position from the Y position property.int
getWidth()
Retrieves the width from the width property.int
hashCode()
-
-
-
Constructor Detail
-
RectangleImpl
public RectangleImpl(int aPositionX, int aPositionY, int aWidth, int aHeight)
Constructs aRectangle
with the given metrics.- Parameters:
aPositionX
- The X position of the rectangle.aPositionY
- The Y position of the rectangle.aWidth
- The width of the rectangle.aHeight
- The height of the rectangle.
-
-
Method Detail
-
getWidth
public int getWidth()
Retrieves the width from the width property.- Specified by:
getWidth
in interfaceWidthAccessor
- Returns:
- The width stored by the width property.
-
getHeight
public int getHeight()
Retrieves the height from the height property.- Specified by:
getHeight
in interfaceHeightAccessor
- Returns:
- The height stored by the height property.
-
getPositionX
public int getPositionX()
Retrieves the X position from the X position property.- Specified by:
getPositionX
in interfacePosXAccessor
- Returns:
- The X position stored by the X position property.
-
getPositionY
public int getPositionY()
Retrieves the Y position from the Y position property.- Specified by:
getPositionY
in interfacePosYAccessor
- Returns:
- The Y position stored by the Y position property.
-
-