Position

public final class Position extends FixedPosition implements MutablePosition

Constructors

Link copied to clipboard
public Position Position()
public Position Position(Double x, Double y)
public Position Position(Float x, Float y)

Properties

Link copied to clipboard
private Float x

The x coordinate.

Link copied to clipboard
private Float y

The y coordinate.

Functions

Link copied to clipboard
public Float deltaX(ImmutablePosition position)

Calculates the difference between the current x and the target position's x-coordinate.

public Float deltaX(Float x)

Calculates the difference between the current x-coordinate and the target x-coordinate.

Link copied to clipboard
public Float deltaY(ImmutablePosition position)

Calculates the difference between the current y and the target position's y-coordinate.

public Float deltaY(Float y)

Calculates the vertical difference between the current y-coordinate and the target y-coordinate.

Link copied to clipboard
public Boolean equals(Object other)
Link copied to clipboard
public Float getX()

The x coordinate.

Link copied to clipboard
public Float getY()

The y coordinate.

Link copied to clipboard
public Integer hashCode()
Link copied to clipboard
public Unit negate()

Negates both the x and y coordinates of the mutable position.

Link copied to clipboard
public Unit offset(ImmutablePosition position)

Offsets both the x and y coordinates of the mutable position based on another position.

public Unit offset(Float dx, Float dy)

Offsets both the x and y coordinates of the mutable position by the specified amounts.

Link copied to clipboard
public Unit set(ImmutablePosition position)

Sets the x and y coordinates of the mutable position based on another position.

public Unit set(Float x, Float y)

Sets the x and y coordinates of the mutable position.

Link copied to clipboard
public Unit setX(Float x)

The x coordinate.

Link copied to clipboard
public Unit setY(Float y)

The y coordinate.

Link copied to clipboard

Initializes a ImmutablePosition with the current x and y coordinates.

Link copied to clipboard
public String toString()
Link copied to clipboard
public Unit xOffset(Float dx)

Offsets the x-coordinate of the mutable position by the specified amount.

Link copied to clipboard
public Unit yOffset(Float dy)

Offsets the y-coordinate of the mutable position by the specified amount.