Top Description Fields Constructors Methods
org.lwjgl.util

public final Class Point

extends Object
implements ReadablePoint, WritablePoint, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.lwjgl.util.WritablePoint, org.lwjgl.util.ReadablePoint
Imports
java.io.Serializable

A 2D integer point class, which looks remarkably like an AWT one.
Author
$Author$
Version
$Revision$ $Id$

Field Summary

Modifier and TypeField and Description
pack-priv static final long
private int
x

The location

private int
y

The location

Constructor Summary

AccessConstructor and Description
public
Point()

Constructor for Point.

public
Point(int x, int y)

Constructor for Point.

public
Point(ReadablePoint p)

Constructor for Point.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the object to be compared is an instance of Point and has the same values; false otherwise
equals
(Object
an object to be compared with this point
obj
)

Overrides java.lang.Object.equals.

Determines whether an instance of Point2D is equal to this point.
public void
getLocation(WritablePoint
The destination Point, or null, to create a new Point
dest
)

Implements org.lwjgl.util.ReadablePoint.getLocation.

Copy this ReadablePoint into a destination Point
public int
public int
public int

Returns:

a hash code for this Point
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code for this Point.
public void
public void
public void
public void
public String

Returns:

a string representation of this point
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this point and its location in the (x, y) coordinate space.
public void
translate(int
The translation to apply
dx
,
int
The translation to apply
dy
)

Translate a point.

public void
translate(ReadablePoint
The translation to apply
p
)

Translate a point.

public void
untranslate(ReadablePoint
The translation to apply
p
)

Un-translate a point.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID
xback to summary
private int x

The location

yback to summary
private int y

The location

Constructor Detail

Pointback to summary
public Point()

Constructor for Point.

Pointback to summary
public Point(int x, int y)

Constructor for Point.

Pointback to summary
public Point(ReadablePoint p)

Constructor for Point.

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

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.

Parameters
obj:Object

an object to be compared with this point

Returns:boolean

true if the object to be compared is an instance of Point and has the same values; false otherwise

getLocationback to summary
public void getLocation(WritablePoint dest)

Implements org.lwjgl.util.ReadablePoint.getLocation.

Doc from org.lwjgl.util.ReadablePoint.getLocation.

Copy this ReadablePoint into a destination Point

Parameters
dest:WritablePoint

The destination Point, or null, to create a new Point

getXback to summary
public int getX()

Implements org.lwjgl.util.ReadablePoint.getX.

Returns:int

Doc from org.lwjgl.util.ReadablePoint.getX.

int

getYback to summary
public int getY()

Implements org.lwjgl.util.ReadablePoint.getY.

Returns:int

Doc from org.lwjgl.util.ReadablePoint.getY.

int

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code for this Point.

Returns:int

a hash code for this Point

setLocationback to summary
public void setLocation(int x, int y)

Implements org.lwjgl.util.WritablePoint.setLocation.

setLocationback to summary
public void setLocation(ReadablePoint p)

Implements org.lwjgl.util.WritablePoint.setLocation.

setXback to summary
public void setX(int x)

Implements org.lwjgl.util.WritablePoint.setX.

setYback to summary
public void setY(int y)

Implements org.lwjgl.util.WritablePoint.setY.

toStringback to summary
public String toString()

Overrides java.lang.Object.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.

Returns:String

a string representation of this point

translateback to summary
public void translate(int dx, int dy)

Translate a point.

Parameters
dx:int

The translation to apply

dy:int

The translation to apply

translateback to summary
public void translate(ReadablePoint p)

Translate a point.

Parameters
p:ReadablePoint

The translation to apply

untranslateback to summary
public void untranslate(ReadablePoint p)

Un-translate a point.

Parameters
p:ReadablePoint

The translation to apply