public class Box extends Object
Constructor and Description |
---|
Box()
Create a new Box with some default coordinates (x,y) set to (0,0) and
with width and height set to 0.
|
Box(Box src)
copy constructor.
|
Box(int newX,
int newY,
int newWidth,
int newHeight)
Create a new Box with the given coordinates.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getHeight()
Get the current height for the box.
|
int |
getWidth()
Get the current width of the box.
|
int |
getX()
Get the horizontal position of the box.
|
int |
getY()
Get the vertical position of the box.
|
int |
hashCode() |
void |
setHeight(int newHeight)
Set a new height for the box.
|
void |
setWidth(int newWidth)
Set a new width for the box.
|
void |
setX(int newX)
Get the horizontal position of the box.
|
void |
setY(int newY)
Set the vertical position of the box.
|
public Box()
public Box(int newX, int newY, int newWidth, int newHeight)
newX
- the x position of the boxnewY
- the y position of the boxnewWidth
- the new width of the boxnewHeight
- the new height of the boxpublic Box(Box src)
src
- src box to copy frompublic final int getX()
public final void setX(int newX)
newX
- the vertical position of the boxpublic final int getY()
public final void setY(int newY)
newY
- the vertical position of the boxpublic final int getHeight()
public final void setHeight(int newHeight)
newHeight
- the new height for the box.public final int getWidth()
public final void setWidth(int newWidth)
newWidth
- the new widthCopyright © 2013. All Rights Reserved.