Size
Leave feedback
On this page
Inheritance: java.lang.Object
public class Size
Represents a size.
| Constructor | Description |
|---|---|
| Size(double width, double height) | Initializes a new instance of the Size class. |
| Method | Description |
|---|---|
| getWidth() | Gets the width. |
| getHeight() | Gets the height. |
| isEmpty() | Gets a value that indicates whether the size is empty. |
| parse(String s) | Converts the string representation of a size to its class equivalent. |
| toString() |
public Size(double width, double height)
Initializes a new instance of the Size class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| width | double | The width in pixels. |
| height | double | The height in pixels. |
public double getWidth()
Gets the width.
Returns: double - A double value that represents the width in pixels.
public double getHeight()
Gets the height.
Returns: double - A double value that represents the height in pixels.
public boolean isEmpty()
Gets a value that indicates whether the size is empty.
Returns: boolean - true if the width and height are zero; otherwise, false .
public static Size parse(String s)
Converts the string representation of a size to its class equivalent. A return value indicates whether the conversion is succeeded or failed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| s | java.lang.String | A string containing a size to convert. |
Returns: Size - The instance of Size class that is equivalent to the value specified in s parameter.
public String toString()
Returns: java.lang.String
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.