Class Point

java.lang.Object
com.pdftools.geometry.units.Point

public class Point extends 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 Details

  • Method Details

    • parse

      public static Point parse(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 String toString()
      Creates a string representation as x-y-pair with associated suitable metric units, "m", "cm" or "mm".
      Overrides:
      toString in class Object
    • toString

      public 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(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object