public final class Point2F
extends java.lang.Object
Point2F denotes a point in 2D-space.
This class is immutable and therefore thread-safe.
| Modifier and Type | Field and Description |
|---|---|
float |
x
The X-coordinate.
|
float |
y
The Y-coordinate.
|
| Constructor and Description |
|---|
Point2F()
Constructs a new
Point2F instance. |
Point2F(float x,
float y)
Constructs a new
Point2F instance given its coordinates. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object)
Compares
object to this Point2F instance for equality. |
int |
hashCode()
Returns a hash code for this
Point2F instance. |
java.lang.String |
toString()
Returns a
String representation of this Point2F instance. |
public Point2F()
Point2F instance.
Calling this constructor is equivalent to the following:
new Point2F(0.0F, 0.0F)
public Point2F(float x,
float y)
Point2F instance given its coordinates.x - the X-coordinatey - the Y-coordinatepublic java.lang.String toString()
String representation of this Point2F instance.toString in class java.lang.ObjectString representation of this Point2F instancepublic boolean equals(java.lang.Object object)
object to this Point2F instance for equality.
Returns true if, and only if, object is an instance of Point2F, and their respective values are equal, false otherwise.
equals in class java.lang.Objectobject - the Object to compare to this Point2F instance for equalitytrue if, and only if, object is an instance of Point2F, and their respective values are equal, false otherwisepublic int hashCode()
Point2F instance.hashCode in class java.lang.ObjectPoint2F instance