public class WeightedRectangle extends Object
Modifier and Type | Field and Description |
---|---|
int |
height
The height
|
float |
weight
The weight assigned to the rectangle
|
int |
width
The width
|
int |
x
The top-left x-ordinate
|
int |
y
The top-left y-ordinate
|
Constructor and Description |
---|
WeightedRectangle(int x,
int y,
int width,
int height,
float weight)
Construct a
WeightedRectangle with the given parameters. |
Modifier and Type | Method and Description |
---|---|
static WeightedRectangle |
parse(String str)
parse a string of the form "x y width height weight" to construct a
WeightedRectangle.
|
public float weight
public int height
public int width
public int y
public int x
public WeightedRectangle(int x, int y, int width, int height, float weight)
WeightedRectangle
with the given parameters.x
- x-coordinate of top-lefty
- y-coordinate of top-leftwidth
- widthheight
- heightweight
- weightpublic static WeightedRectangle parse(String str)
str
- the string to parse