Package org.jgrapht.alg.drawing.model
Class Point2D
- java.lang.Object
-
- org.jgrapht.alg.drawing.model.Point2D
-
- All Implemented Interfaces:
java.io.Serializable
public class Point2D extends java.lang.Object implements java.io.SerializableA 2-dimensional point in Euclidean space.- Author:
- Dimitrios Michail
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Point2D(double x, double y)Create a new point
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)intgetNumDimensions()Get the number of dimensions of the pointdoublegetX()Get the x coordinatedoublegetY()Get the y coordinateinthashCode()static Point2Dof(double x, double y)Create a new pointjava.lang.StringtoString()
-
-
-
Method Detail
-
getNumDimensions
public int getNumDimensions()
Get the number of dimensions of the point- Returns:
- the number of dimensions of the point
-
getX
public double getX()
Get the x coordinate- Returns:
- the x coordinate
-
getY
public double getY()
Get the y coordinate- Returns:
- the y coordinate
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
of
public static Point2D of(double x, double y)
Create a new point- Parameters:
x- the x coordinatey- the y coordinate- Returns:
- the point
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-