20 package net.sf.gridarta.utils;
22 import java.io.Serializable;
23 import org.jetbrains.annotations.Nullable;
30 public class Size2D implements Serializable {
63 public Size2D(
final int width,
final int height) {
65 throw new IllegalArgumentException(
"Width must be > 0");
68 throw new IllegalArgumentException(
"Height must be > 0");
76 public boolean equals(@Nullable
final Object obj) {
80 if (obj == null || obj.getClass() != getClass()) {
84 return height == other.
height && width == other.
width;
89 return height ^ width << 16 ^ width >> 16;
110 return width +
"x" +
height;
boolean equals(@Nullable final Object obj)
static final Size2D ONE
One size object.
final int width
The width of the area.
final int height
The height of the area.
int getWidth()
Returns the width of the area.
static final long serialVersionUID
Serial Version.
int getHeight()
Returns the height of the area.
Size2D(final int width, final int height)
Create a new Size2D.
The class Size2D represents a 2d rectangular area.