Package com.iizix
Class Size
java.lang.Object
com.iizix.Size
- All Implemented Interfaces:
Serializable
,Cloneable
A size with integers.
- Author:
- Christopher Mindus
- See Also:
Field Summary
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones this instance.static int
compareWidthThenHeight
(Size s1, Size s2) Compares to sizes by first the width, then the height.boolean
Check for equality.int
hashCode()
Hash code.toString()
Creates the string representation of this position as className[width=NN,height=NN].
Field Details
width
public int widthThe width.height
public int heightThe height.
Constructor Details
Size
public Size()Constructs a size initialized to 0,0.Size
public Size(int width, int height) Constructs and initializes position.- Parameters:
width
- The width.height
- The height.
Size
Constructs and initializes position.- Parameters:
s
- Another size.
Method Details
equals
Check for equality.clone
Clones this instance.hashCode
public int hashCode()Hash code.toString
Creates the string representation of this position as className[width=NN,height=NN].compareWidthThenHeight
Compares to sizes by first the width, then the height.- Parameters:
s1
- Size 1 (null allowed).s2
- Size 2 (null allowed).- Returns:
- 1 if s2 is wider then higher than s1 (or s2 is null), -1 if smaller (or s1 is null), 0 if equal (both null).