public class Size
extends java.lang.Object
Constructor and Description |
---|
Size(int width,
int height)
Create a new Size instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Check if this size is equal to another size.
|
int |
getHeight()
Get the height of the size.
|
int |
getWidth()
Get the width of the size.
|
int |
hashCode() |
java.lang.String |
toString()
Return the size represented as a string with the format
"WxH" |
public Size(int width, int height)
width
- The width of the sizeheight
- The height of the sizepublic int getWidth()
public int getHeight()
public boolean equals(java.lang.Object obj)
Two sizes are equal if and only if both their widths and heights are equal.
A size object is never equal to any other type of object.
equals
in class java.lang.Object
true
if the objects were equal, false
otherwisepublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
"WxH"
toString
in class java.lang.Object