Package org.lwjgl.util

# Class Point

java.lang.Object
org.lwjgl.util.Point

All Implemented Interfaces:
  `Serializable`, `ReadablePoint`, `WritablePoint`

public final class Point extends Object implements ReadablePoint, WritablePoint, Serializable
A 2D integer point class, which looks remarkably like an AWT one.

Version:
  $Revision$ $Id$
Author:
  $Author$
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`Point()`
Constructor for Point.
`Point(int x, int y)`
Constructor for Point.
`Point(ReadablePoint p)`
Constructor for Point.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
Determines whether an instance of `Point2D` is equal to this point.
`void`
`getLocation(WritablePoint dest)`
Copy this ReadablePoint into a destination Point
`int`
`getX()`
`int`
`getY()`
`int`
`hashCode()`
Returns the hash code for this `Point`.
`void`
`setLocation(int x, int y)`
`void`
`setLocation(ReadablePoint p)`
`void`
`setX(int x)`
`void`
`setY(int y)`
`String`
`toString()`
Returns a string representation of this point and its location in the (x, y) coordinate space.
`void`
`translate(int dx, int dy)`
Translate a point.
`void`
`translate(ReadablePoint p)`
Translate a point.
`void`
`untranslate(ReadablePoint p)`
Un-translate a point.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### Point

public Point()
Constructor for Point.

### Point

public Point(int x, int y)
Constructor for Point.

### Point

public Point(ReadablePoint p)
Constructor for Point.

## Method Details

### setLocation

public void setLocation(int x, int y)

Specified by:
  `setLocation` in interface `WritablePoint`

### setLocation

public void setLocation(ReadablePoint p)

Specified by:
  `setLocation` in interface `WritablePoint`

### setX

public void setX(int x)

Specified by:
  `setX` in interface `WritablePoint`

### setY

public void setY(int y)

Specified by:
  `setY` in interface `WritablePoint`

### translate

public void translate(int dx, int dy)
Translate a point.

Parameters:
  `dx` - The translation to apply
  `dy` - The translation to apply

### translate

public void translate(ReadablePoint p)
Translate a point.

Parameters:
  `p` - The translation to apply

### untranslate

public void untranslate(ReadablePoint p)
Un-translate a point.

Parameters:
  `p` - The translation to apply

### equals

public boolean equals(Object obj)
Determines whether an instance of `Point2D` is equal to this point. 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.

Overrides:
  `equals` in class `Object`
Parameters:
  `obj` - an object to be compared with this point
Returns:
  `true` if the object to be compared is an instance of `Point` and has the same values; `false` otherwise

### toString

public String toString()
Returns a string representation of this point and its location in the (x, y) coordinate space. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be `null`.

Overrides:
  `toString` in class `Object`
Returns:
  a string representation of this point

### hashCode

public int hashCode()
Returns the hash code for this `Point`.

Overrides:
  `hashCode` in class `Object`
Returns:
  a hash code for this `Point`

### getX

public int getX()

Specified by:
  `getX` in interface `ReadablePoint`
Returns:
  int

### getY

public int getY()

Specified by:
  `getY` in interface `ReadablePoint`
Returns:
  int

### getLocation

public void getLocation(WritablePoint dest)
Description copied from interface: `ReadablePoint`
Copy this ReadablePoint into a destination Point

Specified by:
  `getLocation` in interface `ReadablePoint`
Parameters:
  `dest` - The destination Point, or null, to create a new Point