public class RectangleSize extends Object
| Constructor and Description |
|---|
RectangleSize(int width,
int height)
Creates a new RectangleSize instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
getHeight() |
int |
getWidth() |
int |
hashCode() |
static RectangleSize |
parse(String size)
Parses a string into a {link RectangleSize} instance.
|
RectangleSize |
scale(double scaleRatio)
Get a scaled version of the current size.
|
String |
toString() |
public RectangleSize(int width,
int height)
width - The width of the rectangle.height - The height of the rectangle.public int getWidth()
public int getHeight()
public static RectangleSize parse(String size)
size - A string representing width and height separated by "x".public RectangleSize scale(double scaleRatio)
scaleRatio - The ratio by which to scale.public boolean equals(Object obj)
equals in class Objectobj - A RectangleSize instance to be
checked for equality with the current instance.true if and only if the input objects are equal by
value, false otherwise.Copyright © 2017. All rights reserved.