java.lang.Object
de.vwsoft.barcodelib4j.twod.TwoDSize
- All Implemented Interfaces:
Comparable<TwoDSize>
Immutable pair of width and height.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTwoDSize
(int width, int height) Creates a new instance with the specified width and height. -
Method Summary
Modifier and TypeMethodDescriptionint
Compares this object with anotherTwoDSize
object.boolean
Indicates whether some other object is "equal to" this one.int
hashCode()
Returns the hash code calculated from the width and height values.toString()
Returns a string representation of this instance.
-
Field Details
-
width
public final int widthThe width value. -
height
public final int heightThe height value.
-
-
Constructor Details
-
TwoDSize
public TwoDSize(int width, int height) Creates a new instance with the specified width and height.- Parameters:
width
- the widthheight
- the height
-
-
Method Details
-
compareTo
Compares this object with anotherTwoDSize
object. First, widths are compared; if they are equal, heights are compared.- Specified by:
compareTo
in interfaceComparable<TwoDSize>
- Parameters:
other
- theTwoDSize
to be compared- Returns:
- a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object
-
equals
Indicates whether some other object is "equal to" this one. Returnstrue
if and only if the parameter is also an instance of this class and both instances have the same width and height values. -
hashCode
public int hashCode()Returns the hash code calculated from the width and height values. -
toString
Returns a string representation of this instance. This method is intended to be used only for debugging purposes.
-