Package com.pdftools.geometry.units
Class Point
- java.lang.Object
-
- com.pdftools.geometry.units.Point
-
public class Point extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)LengthgetX()Gets the horizontal coordinate asLengthobject.LengthgetY()Gets the vertical coordinate asLengthobject.inthashCode()static Pointparse(java.lang.String value)Create aPointobject from the string representation of a x-y-coordinate pair.java.lang.StringtoString()Creates a string representation as x-y-pair with associated suitable metric units, "m", "cm" or "mm".java.lang.StringtoString(Length.Units unit)Creates a string representation as x-y-pair with the specified unit.
-
-
-
Method Detail
-
parse
public static Point parse(java.lang.String value)
Create aPointobject 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:
toStringin classjava.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
Lengthobject.The horizontal axis is oriented from left to right.
-
getY
public Length getY()
Gets the vertical coordinate as
Lengthobject.The vertical axis is oriented from bottom to top.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-