public class Size extends Object
| Constructor and Description |
|---|
Size(double width,
double height)
Initializes a new instance of the
Size class. |
| Modifier and Type | Method and Description |
|---|---|
double |
getHeight()
Gets the height.
|
double |
getWidth()
Gets the width.
|
boolean |
isEmpty()
Gets a value that indicates whether the size is empty.
|
static Size |
parse(String s)
Converts the string representation of a size to its class equivalent.
|
String |
toString() |
public Size(double width,
double height)
Size class.width - The width in pixels.height - The height in pixels.public double getWidth()
public double getHeight()
public boolean isEmpty()
true if the width and height are zero; otherwise, false.public static Size parse(String s)
s - A string containing a size to convert.Size class that is equivalent to the value specified in s parameter.IllegalArgumentException - s does not represent a size in a valid format.Copyright © 2026. All rights reserved.