Class Point


  • public class Point
    extends java.lang.Object

    Class that represents a point that is based on a X-coordinate and a Y-coordinate of type Length.

    Creates a Point object by parsing a string representation and creates a string representation of a Point object.

    • Constructor Summary

      Constructors 
      Constructor Description
      Point​(Length x, Length y)
      Construct Point object from x and y.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      Length getX()
      Gets the horizontal coordinate as Length object.
      Length getY()
      Gets the vertical coordinate as Length object.
      int hashCode()  
      static Point parse​(java.lang.String value)
      Create a Point object from the string representation of a x-y-coordinate pair.
      java.lang.String toString()
      Creates a string representation as x-y-pair with associated suitable metric units, "m", "cm" or "mm".
      java.lang.String toString​(Length.Units unit)
      Creates a string representation as x-y-pair with the specified unit.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • parse

        public static Point parse​(java.lang.String value)
        Create a Point object from the string representation of a x-y-coordinate pair.
        Parameters:
        value - Allowed values are value-unit pairs of the form "<x_value><x_unit> <y_value><y_unit>". Allowed associated units are "um", "mm", "cm", "m", "km", "pt" and "in". Example: "12.3cm 23.9mm".
        Returns:
      • toString

        public java.lang.String toString()
        Creates a string representation as x-y-pair with associated suitable metric units, "m", "cm" or "mm".
        Overrides:
        toString in class java.lang.Object
      • toString

        public java.lang.String toString​(Length.Units unit)
        Creates a string representation as x-y-pair with the specified unit.
      • getX

        public Length getX()

        Gets the horizontal coordinate as Length object.

        The horizontal axis is oriented from left to right.

      • getY

        public Length getY()

        Gets the vertical coordinate as Length object.

        The vertical axis is oriented from bottom to top.

      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object