public final class FloatDimension extends Object
The height and width are stored as floating-point numbers.
| 构造器 | 说明 |
|---|---|
FloatDimension(float width,
float height) |
A constructor used to create a
FloatDimension object with the specified width and height. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
equals(Object obj) |
Checks whether a given object is the same as the current
FloatDimension object. |
float |
getHeightSize() |
Obtains the height of the current
FloatDimension object. |
float |
getWidthSize() |
Obtains the width of the current
FloatDimension object. |
int |
hashCode() |
Obtains the hash code of the current
FloatDimension object. |
static FloatDimension |
parseFloatDimension(String floatDimension) |
Creates a
FloatDimension object based on a given string. |
String |
toString() |
Obtains the string representation of the current
FloatDimension object. |
public FloatDimension(float width,
float height)
FloatDimension object with the specified width and height.width - Indicates the width of the object.height - Indicates the height of the object.public float getWidthSize()
FloatDimension object.FloatDimension object.public float getHeightSize()
FloatDimension object.FloatDimension object.public static FloatDimension parseFloatDimension(String floatDimension) throws NumberFormatException
FloatDimension object based on a given string.
The given string consists of two floating-point numbers (either positive or negative)
separated by an asterisk (*) (ASCII 0x2A) in the format of W*H, for example,
8.5*10.2 or -6.3*-8.4.
floatDimension - Indicates the string used to create the FloatDimension object.FloatDimension object.NullPointerException - Throws this exception if floatDimension is null.NumberFormatException - Throws this exception if the specified string is illegal.public int hashCode()
FloatDimension object.hashCode 在类中 ObjectFloatDimension object.Object.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public boolean equals(Object obj)
FloatDimension object.equals 在类中 Objectobj - Indicates the object to be compared with the current FloatDimension object.true if the two objects are the same; returns false otherwise.Object.hashCode(),
HashMappublic String toString()
FloatDimension object.
The returned string consists of two floating-point numbers (either positive or negative)
separated by an asterisk (*) (ASCII 0x2A) in the format of W*H, for example,
8.5*10.2 or -6.3*-8.4.