|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--GOV.nasa.gsfc.sea.util.DoublePoint
DoublePoint is a version of java.awt.Point that stores the x and y components as doubles rather than ints. The code is an almost exact copy of java.awt.Point with the ints replaced with doubles.
This code was developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project.
Point
, Serialized FormField Summary | |
double |
x
The x coordinate. |
double |
y
The y coordinate. |
Constructor Summary | |
DoublePoint()
Constructs and initializes a point at the origin (0, 0) 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 DoublePoint object. |
|
DoublePoint(java.awt.Point p)
Constructs and initializes a point with the same location as the specified Point object. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Determines whether two points are equal. |
int |
hashCode()
Returns the hashcode for this DoublePoint. |
void |
move(double x,
double y)
Moves this point to the specificed location in the (x, y) coordinate plane. |
java.lang.String |
toString()
Returns a string representation of this point and its location in the (x, y) coordinate space. |
void |
translate(double dx,
double dy)
Translates this point, at location (x, y), by dx along the x axis and dy along the y axis so that it now represents the point (x + dx, y + dy). |
Methods inherited from class java.lang.Object |
|
Field Detail |
public double x
public double y
Constructor Detail |
public DoublePoint()
public DoublePoint(DoublePoint p)
public DoublePoint(java.awt.Point p)
public DoublePoint(double x, double y)
Method Detail |
public void move(double x, double y)
public void translate(double dx, double dy)
public boolean equals(java.lang.Object obj)
DoublePoint
are equal if the values of their
x
and y
member fields, representing
their position in the coordinate space, are the same.equals
in class java.lang.Object
obj
- an object to be compared with this point.true
if the object to be compared is
an instance of DoublePoint
and has
the same values; false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |