java.lang.Object
de.vwsoft.barcodelib4j.twod.TwoDSize
- All Implemented Interfaces:
Comparable<TwoDSize>
Immutable pair of width and height.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTwoDSize(int width, int height) Creates a new instance with the specified width and height. -
Method Summary
Modifier and TypeMethodDescriptionintCompares this object with anotherTwoDSizeobject.booleanIndicates whether some other object is "equal to" this one.inthashCode()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 anotherTwoDSizeobject. First, widths are compared; if they are equal, heights are compared.- Specified by:
compareToin interfaceComparable<TwoDSize>- Parameters:
other- theTwoDSizeto 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. Returnstrueif 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.
-