Java DTV API 1.3
18-Nov-2009

com.sun.dtv.lwuit.geom
Class Point

java.lang.Object
  extended by com.sun.dtv.lwuit.geom.Point

public class Point
extends Object

A point representing a location in (x, y) coordinate space, specified in integer precision.


Constructor Summary
Point()
          Constructs and initializes a point at the origin (0, 0) of the coordinate space.
Point(int x, int y)
          Constructs and initializes a point at the specified (x, y) location in the coordinate space.
Point(Point p)
          Constructs and initializes a point with the same location as the specified Point object.
 
Method Summary
 Object clone()
          Creates a new object of the same class and with the same contents as this object.
 boolean equals(Object obj)
          Determines whether or not two points are equal.
 Point getLocation()
          Returns the location of this point.
 int getX()
          Returns the x coordinate of this Point.
 int getY()
          Returns the y coordinate of this Point.
 int hashCode()
          Returns the hashcode for this Point.
 void move(int x, int y)
          Moves this point to the specified location in the (x, y) coordinate plane.
 void setLocation(int x, int y)
          Changes the point to have the specified location.
 void setLocation(Point p)
          Sets the location of the point to the specified location.
 String toString()
          Returns a string representation of this point and its location in the (x, y) coordinate space.
 void translate(int dx, int 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
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Point

public Point()
Constructs and initializes a point at the origin (0, 0) of the coordinate space.


Point

public Point(int x,
             int y)
Constructs and initializes a point at the specified (x, y) location in the coordinate space.

Parameters:
x - the x coordinate
y - the y coordinate

Point

public Point(Point p)
Constructs and initializes a point with the same location as the specified Point object.

Parameters:
p - the specified Point object
Method Detail

getX

public int getX()
Returns the x coordinate of this Point.

Returns:
the x coordinate of this Point

getY

public int getY()
Returns the y coordinate of this Point.

Returns:
the y coordinate of this Point

clone

public Object clone()
Creates a new object of the same class and with the same contents as this object.

Overrides:
clone in class Object
Returns:
the new Point

equals

public boolean equals(Object obj)
Determines whether or not two points are equal.

Overrides:
equals in class Object
Parameters:
obj - the Point to be compared to
Returns:
true if points are equal, false otherwise

getLocation

public Point getLocation()
Returns the location of this point.

Returns:
the location
See Also:
setLocation(int, int)

hashCode

public int hashCode()
Returns the hashcode for this Point.

Overrides:
hashCode in class Object
Returns:
the hashcode

move

public void move(int x,
                 int y)
Moves this point to the specified location in the (x, y) coordinate plane.

Parameters:
x - x coordinate of the specified location
y - y coordinate of the specified location

setLocation

public void setLocation(int x,
                        int y)
Changes the point to have the specified location.

Parameters:
x - x coordinate of the specified location
y - y coordinate of the specified location
See Also:
getLocation()

setLocation

public void setLocation(Point p)
Sets the location of the point to the specified location.

Parameters:
p - the Point of the specified location
See Also:
getLocation()

toString

public String toString()
Returns a string representation of this point and its location in the (x, y) coordinate space.

Overrides:
toString in class Object
Returns:
the String representation

translate

public void translate(int dx,
                      int 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).

Parameters:
dx - translation value in x direction
dy - translation value in y direction

Java DTV API 1.3
18-Nov-2009

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.