public class DoublePoint
extends java.lang.Object
implements java.io.Serializable
DoublePoint
class represents a location in a
two-dimensional (x, y) double-valued coordinate space.Modifier and Type | Field and Description |
---|---|
double |
x
The x coordinate.
|
double |
y
The y coordinate.
|
Constructor and Description |
---|
DoublePoint()
Constructs and initializes a point at the origin
(0.0D, 0.0D) of the coordinate space.
|
DoublePoint(double x,
double y)
Constructs and initializes a point at the specified
(x, y) location in the coordinate space.
|
DoublePoint(DoublePoint p)
Constructs and initializes a point with the same location as
the specified
Point object. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Compares this object against the specified object.
|
int |
hashCode()
Returns a hashcode for this Double.
|
java.lang.String |
toString()
Returns a String representation of this DoublePoint object.
|
public DoublePoint()
public DoublePoint(DoublePoint p)
Point
object.p
- a point.public DoublePoint(double x, double y)
x
- the x coordinate.y
- the y coordinate.public int hashCode()
hashCode
in class java.lang.Object
hash code
value for this object.public boolean equals(java.lang.Object obj)
true
if and only if the argument is
not null
and is a DoublePoint
object
such that the respective components are equal according to the rules
of Double.equal()
.equals
in class java.lang.Object
obj
- the object to compare with.true
if the objects are the same;
false
otherwise.public java.lang.String toString()
toString
in class java.lang.Object