Class Point

    • Constructor Detail

      • Point

        public Point​(int x,
                     int y)
      • Point

        public Point()
    • Method Detail

      • clone

        public Object clone()
      • equals

        public boolean equals​(Object obj)
        Description copied from interface: PointImmutable
        Checks whether two points objects are equal. Two instances of PointReadOnly are equal if the two components y and x are equal.
        Specified by:
        equals in interface PointImmutable
        Overrides:
        equals in class Object
        Returns:
        true if the two points are equal; otherwise false.
      • set

        public final Point set​(int x,
                               int y)
        Set this instance's x- and y-component.
        Parameters:
        x - value for x-component
        y - value for y-component
        Returns:
        this instance for scaling
      • setX

        public final Point setX​(int x)
        Set this instance's x--component.
        Parameters:
        x - value for x-component
        Returns:
        this instance for scaling
      • setY

        public final Point setY​(int y)
        Set this instance's y-component.
        Parameters:
        y - value for y-component
        Returns:
        this instance for scaling
      • translate

        public final Point translate​(Point pd)
        Translate this instance's x- and y-components, i.e. add the values of the given delta point to them.
        Parameters:
        pd - delta point
        Returns:
        this instance for scaling
      • translate

        public final Point translate​(PointImmutable pd)
        Translate this instance's x- and y-components, i.e. add the values of the given delta point to them.
        Parameters:
        pd - delta point
        Returns:
        this instance for scaling
      • translate

        public final Point translate​(int dx,
                                     int dy)
        Translate this instance's x- and y-components, i.e. add the given deltas to them.
        Parameters:
        dx - delta for x
        dy - delta for y
        Returns:
        this instance for scaling
      • scale

        public final Point scale​(int sx,
                                 int sy)
        Scale this instance's x- and y-components, i.e. multiply them by the given scale factors.
        Parameters:
        sx - scale factor for x
        sy - scale factor for y
        Returns:
        this instance for scaling
      • scale

        public final Point scale​(float sx,
                                 float sy)
        Scale this instance's x- and y-components, i.e. multiply them by the given scale factors.

        The product is rounded back to integer.

        Parameters:
        sx - scale factor for x
        sy - scale factor for y
        Returns:
        this instance for scaling
      • scaleInv

        public final Point scaleInv​(int sx,
                                    int sy)
        Inverse scale this instance's x- and y-components, i.e. divide them by the given scale factors.
        Parameters:
        sx - inverse scale factor for x
        sy - inverse scale factor for y
        Returns:
        this instance for scaling
      • scaleInv

        public final Point scaleInv​(float sx,
                                    float sy)
        Inverse scale this instance's x- and y-components, i.e. divide them by the given scale factors.

        The product is rounded back to integer.

        Parameters:
        sx - inverse scale factor for x
        sy - inverse scale factor for y
        Returns:
        this instance for scaling