Package com.iizix
Class DSize
java.lang.Object
com.iizix.DSize
- All Implemented Interfaces:
Serializable
,Cloneable
A size with double's.
- Author:
- Christopher Mindus
- See Also:
Field Summary
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones this instance.static int
compareWidthThenHeight
(DSize s1, DSize 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 double widthThe width.height
public double heightThe height.
Constructor Details
DSize
public DSize()Constructs a size initialized to 0,0.DSize
public DSize(double width, double height) Constructs and initializes position.- Parameters:
width
- The width.height
- The height.
DSize
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 (or both null).