java::awt::geom::Point2D Class Reference

Inheritance diagram for java::awt::geom::Point2D:

Inheritance graph
java::awt::Pointjava::lang::Objectjava::awt::Rectangle
[legend]
Collaboration diagram for java::awt::geom::Point2D:

Collaboration graph
java::lang::Object
[legend]

List of all members.


Detailed Description

The Point2D class defines a point representing a location in (x, y) coordinate space.

This class is only the abstract superclass for all objects that store a 2D coordinate. The actual storage representation of the coordinates is left to the subclass.

Version:
1.17, 01/23/03
Author:
Jim Graham

Public Member Functions

virtual jdouble getX () const =0
 Returns the X coordinate of this Point2D in double precision.
virtual jdouble getY () const =0
 Returns the Y coordinate of this Point2D in double precision.
virtual void setLocation (jdouble x, jdouble y)=0
 Sets the location of this Point2D to the specified double coordinates.
virtual void setLocation (const Point2D &p)
 Sets the location of this Point2D to the same coordinates as the specified Point2D object.
virtual jdouble distanceSq (jdouble PX, jdouble PY) const
 Returns the square of the distance from this Point2D to a specified point.
virtual jdouble distanceSq (const Point2D &pt) const
 Returns the square of the distance from this Point2D to a specified Point2D.
virtual jdouble distance (jdouble PX, jdouble PY) const
 Returns the distance from this Point2D to a specified point.
virtual jdouble distance (const Point2D &pt) const
 Returns the distance from this Point2D to a specified Point2D.
 Float (jfloat x=0, jfloat y=0)
 Constructs and initializes a Point2D with the specified coordinates.
virtual jdouble getX () const
 Returns the X coordinate of this Point2D in double precision.
virtual jdouble getY () const
 Returns the Y coordinate of this Point2D in double precision.
virtual void setLocation (jdouble x, jdouble y)
 Sets the location of this Point2D to the specified double coordinates.
virtual void setLocation (jfloat x, jfloat y)
 Sets the location of this Point2D to the specified float coordinates.
virtual void setLocation (const Point2D &p)
 Sets the location of this Point2D to the same coordinates as the specified Point2D object.
virtual void setLocation (const Float &p)
 Sets the location of this Point2D to the same coordinates as the specified Point2D object.
virtual jint hashCode () const
 Returns the hashcode for this Point2D.
virtual jboolean equals (const Object &obj) const
 Determines whether or not two points are equal.
virtual String toString () const
 Returns a String that represents the value of this Point2D.
 Double (jdouble x=0, jdouble y=0)
 Constructs and initializes a Point2D with the specified coordinates.
virtual jdouble getX () const
 Returns the X coordinate of this Point2D in double precision.
virtual jdouble getY () const
 Returns the Y coordinate of this Point2D in double precision.
virtual void setLocation (jdouble x, jdouble y)
 Sets the location of this Point2D to the specified double coordinates.
virtual void setLocation (const Point2D &p)
 Sets the location of this Point2D to the same coordinates as the specified Point2D object.
virtual void setLocation (const Double &p)
 Sets the location of this Point2D to the same coordinates as the specified Point2D object.
virtual jint hashCode () const
 Returns the hashcode for this Point2D.
virtual jboolean equals (const Object &obj) const
 Determines whether or not two points are equal.
virtual String toString () const
 Returns a String that represents the value of this Point2D.

Static Public Member Functions

static jdouble distanceSq (jdouble X1, jdouble Y1, jdouble X2, jdouble Y2)
 Returns the square of the distance between two points.
static jdouble distance (jdouble X1, jdouble Y1, jdouble X2, jdouble Y2)
 Returns the distance between two points.

Public Attributes

jfloat x
 The X coordinate of this Point2D.
jfloat y
 The Y coordinate of this Point2D.
jdouble x
 The X coordinate of this Point2D.
jdouble y
 The Y coordinate of this Point2D.

Member Function Documentation

virtual jdouble java::awt::geom::Point2D::getX (  )  const [pure virtual]

Returns the X coordinate of this Point2D in double precision.

Returns:
the X coordinate of this Point2D.
Since:
1.2

Implemented in java::awt::Point, and java::awt::Rectangle.

virtual jdouble java::awt::geom::Point2D::getY (  )  const [pure virtual]

Returns the Y coordinate of this Point2D in double precision.

Returns:
the Y coordinate of this Point2D.
Since:
1.2

Implemented in java::awt::Point, and java::awt::Rectangle.

virtual void java::awt::geom::Point2D::setLocation ( jdouble  x,
jdouble  y 
) [pure virtual]

Sets the location of this Point2D to the specified double coordinates.

Parameters:
x, y the coordinates of this Point2D
Since:
1.2

Implemented in java::awt::Point.

virtual void java::awt::geom::Point2D::setLocation ( const Point2D p  )  [virtual]

Sets the location of this Point2D to the same coordinates as the specified Point2D object.

Parameters:
p the specified Point2D the which to set this Point2D
Since:
1.2

Reimplemented in java::awt::Point.

static jdouble java::awt::geom::Point2D::distanceSq ( jdouble  X1,
jdouble  Y1,
jdouble  X2,
jdouble  Y2 
) [static]

Returns the square of the distance between two points.

Parameters:
X1, Y1 the coordinates of the first point
X2, Y2 the coordinates of the second point
Returns:
the square of the distance between the two sets of specified coordinates.

static jdouble java::awt::geom::Point2D::distance ( jdouble  X1,
jdouble  Y1,
jdouble  X2,
jdouble  Y2 
) [static]

Returns the distance between two points.

Parameters:
X1, Y1 the coordinates of the first point
X2, Y2 the coordinates of the second point
Returns:
the distance between the two sets of specified coordinates.

virtual jdouble java::awt::geom::Point2D::distanceSq ( jdouble  PX,
jdouble  PY 
) const [virtual]

Returns the square of the distance from this Point2D to a specified point.

Parameters:
PX, PY the coordinates of the other point
Returns:
the square of the distance between this Point2D and the specified point.

virtual jdouble java::awt::geom::Point2D::distanceSq ( const Point2D pt  )  const [virtual]

Returns the square of the distance from this Point2D to a specified Point2D.

Parameters:
pt the specified Point2D
Returns:
the square of the distance between this Point2D to a specified Point2D.

virtual jdouble java::awt::geom::Point2D::distance ( jdouble  PX,
jdouble  PY 
) const [virtual]

Returns the distance from this Point2D to a specified point.

Parameters:
PX, PY the coordinates of the specified Point2D
Returns:
the distance between this Point2D and a specified point.

virtual jdouble java::awt::geom::Point2D::distance ( const Point2D pt  )  const [virtual]

Returns the distance from this Point2D to a specified Point2D.

Parameters:
pt the specified Point2D
Returns:
the distance between this Point2D and the specified Point2D.

java::awt::geom::Point2D::Float ( jfloat  x = 0,
jfloat  y = 0 
)

Constructs and initializes a Point2D with the specified coordinates.

Parameters:
x, y the coordinates to which to set the newly constructed Point2D
Since:
1.2

virtual jdouble java::awt::geom::Point2D::getX (  )  const [virtual]

Returns the X coordinate of this Point2D in double precision.

Returns:
the X coordinate of this Point2D.
Since:
1.2

Reimplemented in java::awt::Point, and java::awt::Rectangle.

virtual jdouble java::awt::geom::Point2D::getY (  )  const [virtual]

Returns the Y coordinate of this Point2D in double precision.

Returns:
the Y coordinate of this Point2D.
Since:
1.2

Reimplemented in java::awt::Point, and java::awt::Rectangle.

virtual void java::awt::geom::Point2D::setLocation ( jdouble  x,
jdouble  y 
) [virtual]

Sets the location of this Point2D to the specified double coordinates.

Parameters:
x, y the coordinates of this Point2D
Since:
1.2

Reimplemented in java::awt::Point.

virtual void java::awt::geom::Point2D::setLocation ( jfloat  x,
jfloat  y 
) [virtual]

Sets the location of this Point2D to the specified float coordinates.

Parameters:
x, y the coordinates to which to set this Point2D
Since:
1.2

virtual void java::awt::geom::Point2D::setLocation ( const Point2D p  )  [virtual]

Sets the location of this Point2D to the same coordinates as the specified Point2D object.

Parameters:
p the specified Point2D the which to set this Point2D
Since:
1.2

Reimplemented in java::awt::Point.

virtual void java::awt::geom::Point2D::setLocation ( const Float p  )  [virtual]

Sets the location of this Point2D to the same coordinates as the specified Point2D object.

Parameters:
p the specified Point2D the which to set this Point2D
Since:
1.2

virtual jint java::awt::geom::Point2D::hashCode (  )  const [virtual]

Returns the hashcode for this Point2D.

Returns:
a hash code for this Point2D.

Reimplemented from java::lang::Object.

Reimplemented in java::awt::Point, and java::awt::Rectangle.

virtual jboolean java::awt::geom::Point2D::equals ( const Object obj  )  const [virtual]

Determines whether or not 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 Point2D
Returns:
true if the object to be compared is an instance of Point2D and has the same values; false otherwise.
Since:
1.2

Reimplemented from java::lang::Object.

Reimplemented in java::awt::Point, and java::awt::Rectangle.

virtual String java::awt::geom::Point2D::toString (  )  const [virtual]

Returns a String that represents the value of this Point2D.

Returns:
a string representation of this Point2D.
Since:
1.2

Reimplemented from java::lang::Object.

Reimplemented in java::awt::Point, and java::awt::Rectangle.

java::awt::geom::Point2D::Double ( jdouble  x = 0,
jdouble  y = 0 
)

Constructs and initializes a Point2D with the specified coordinates.

Parameters:
x, y the coordinates to which to set the newly constructed Point2D
Since:
1.2

virtual jdouble java::awt::geom::Point2D::getX (  )  const [virtual]

Returns the X coordinate of this Point2D in double precision.

Returns:
the X coordinate of this Point2D.
Since:
1.2

Reimplemented in java::awt::Point, and java::awt::Rectangle.

virtual jdouble java::awt::geom::Point2D::getY (  )  const [virtual]

Returns the Y coordinate of this Point2D in double precision.

Returns:
the Y coordinate of this Point2D.
Since:
1.2

Reimplemented in java::awt::Point, and java::awt::Rectangle.

virtual void java::awt::geom::Point2D::setLocation ( jdouble  x,
jdouble  y 
) [virtual]

Sets the location of this Point2D to the specified double coordinates.

Parameters:
x, y the coordinates of this Point2D
Since:
1.2

Reimplemented in java::awt::Point.

virtual void java::awt::geom::Point2D::setLocation ( const Point2D p  )  [virtual]

Sets the location of this Point2D to the same coordinates as the specified Point2D object.

Parameters:
p the specified Point2D the which to set this Point2D
Since:
1.2

Reimplemented in java::awt::Point.

virtual void java::awt::geom::Point2D::setLocation ( const Double p  )  [virtual]

Sets the location of this Point2D to the same coordinates as the specified Point2D object.

Parameters:
p the specified Point2D the which to set this Point2D
Since:
1.2

virtual jint java::awt::geom::Point2D::hashCode (  )  const [virtual]

Returns the hashcode for this Point2D.

Returns:
a hash code for this Point2D.

Reimplemented from java::lang::Object.

Reimplemented in java::awt::Point, and java::awt::Rectangle.

virtual jboolean java::awt::geom::Point2D::equals ( const Object obj  )  const [virtual]

Determines whether or not 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 Point2D
Returns:
true if the object to be compared is an instance of Point2D and has the same values; false otherwise.
Since:
1.2

Reimplemented from java::lang::Object.

Reimplemented in java::awt::Point, and java::awt::Rectangle.

virtual String java::awt::geom::Point2D::toString (  )  const [virtual]

Returns a String that represents the value of this Point2D.

Returns:
a string representation of this Point2D.
Since:
1.2

Reimplemented from java::lang::Object.

Reimplemented in java::awt::Point, and java::awt::Rectangle.


Member Data Documentation

jfloat java::awt::geom::Point2D::x

The X coordinate of this Point2D.

Since:
1.2

Reimplemented in java::awt::Point.

jfloat java::awt::geom::Point2D::y

The Y coordinate of this Point2D.

Since:
1.2

Reimplemented in java::awt::Point.

jdouble java::awt::geom::Point2D::x

The X coordinate of this Point2D.

Since:
1.2

Reimplemented in java::awt::Point.

jdouble java::awt::geom::Point2D::y

The Y coordinate of this Point2D.

Since:
1.2

Reimplemented in java::awt::Point.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:21 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3