Class java.awt.geom.Point2D
java.lang.Object
|
+----java.awt.geom.Point2D
- Subclasses:
- Point, Point2D.Double, Point2D.Float
- public abstract class Point2D
- extends Object
- implements Cloneable
A point representing a location in (x, y) coordinate space.
This class is only the abstract superclass for all objects which
store a 2D coordinate.
The actual storage representation of the coordinates is left to
the subclass.
Inner Class Summary
|
static
|
Point2D.Double
A point specified in double precision.
|
static
|
Point2D.Float
A point specified in float precision.
|
Method Summary
|
Object
|
clone()
Creates a new object of the same class as this object.
|
boolean
|
equals(Object obj)
Determines whether two points are equal.
|
double
|
getX()
Returns the X coordinate of the point in double precision.
|
double
|
getY()
Returns the Y coordinate of the point in double precision.
|
void
|
setLocation(double x,
double y)
Sets the location of this point to the specified float coordinates.
|
void
|
setLocation(Point2D p)
Sets the location of this point to the same coordinates as the
specified Point object.
|
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Point2D
protected Point2D()
getX
public abstract double getX()
- Returns the X coordinate of the point in double precision.
getY
public abstract double getY()
- Returns the Y coordinate of the point in double precision.
setLocation
public abstract void setLocation(double x,
double y)
- Sets the location of this point to the specified float coordinates.
setLocation
public void setLocation(Point2D p)
- Sets the location of this point to the same coordinates as the
specified Point object.
clone
public Object clone()
- Creates a new object of the same class as this object.
- Returns:
- a clone of this instance.
- Throws:
- OutOfMemoryError - if there is not enough memory.
- Overrides:
- clone in class Object
- See Also:
- Cloneable
equals
public boolean equals(Object obj)
- Determines whether two points are equal. Two instances of
Point2D
are equal if the values of their
x
and y
member fields, representing
their position in the coordinate space, are the same.
- Parameters:
obj
- an object to be compared with this point.
- Returns:
true
if the object to be compared is
an instance of Point2D
and has
the same values; false
otherwise.- Overrides:
- equals in class Object
Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.