Size

public final class Size

Represents the dimensions of an object with width and height.

It will not accept negative values.

Constructors

Link copied to clipboard
public Size Size()

Initializes an empty size.

public Size Size(Size size)
public Size Size(Integer width, Integer height)

Properties

Link copied to clipboard
private Integer height

The height dimension.

Link copied to clipboard
private Integer width

The width dimension.

Functions

Link copied to clipboard
public Boolean equals(Object other)
Link copied to clipboard
public final Integer getHeight()

The height dimension.

Link copied to clipboard
public final Integer getWidth()

The width dimension.

Link copied to clipboard
public Integer hashCode()
Link copied to clipboard
public final Boolean isEmpty()

Checks if the size is empty.

Link copied to clipboard
public final Unit set(Size size)

Sets the width and height dimensions base on another size.

public final Unit set(Integer width, Integer height)

Sets the width and height coordinates of the size.

Link copied to clipboard
public final Unit setHeight(Integer height)

Changes the height dimension.

Link copied to clipboard
public final Unit setWidth(Integer width)

Changes the height dimension.