Top Fields Constructors Methods
com.jogamp.nativewindow.util

public Class Point

extends Object
implements Cloneable, PointImmutable
Class Inheritance
All Implemented Interfaces
com.jogamp.nativewindow.util.PointImmutable, java.lang.Comparable, com.jogamp.common.type.WriteCloneable, java.lang.Cloneable

Field Summary

Modifier and TypeField and Description
pack-priv int
x

pack-priv int
y

Constructor Summary

AccessConstructor and Description
public
Point(final int x, final int y)

public

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public Object
cloneMutable()

Implements com.jogamp.common.type.WriteCloneable.cloneMutable.

Get a mutable clone from this instance.
public int
compareTo(final PointImmutable
the object to be compared.
d
)

Implements com.jogamp.nativewindow.util.PointImmutable.compareTo.

Compares the square of the position.

public boolean
equals(final Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Implements com.jogamp.nativewindow.util.PointImmutable.equals.

Checks whether two points objects are equal.
public final int
public final int
public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements com.jogamp.nativewindow.util.PointImmutable.hashCode.

Returns a hash code value for this object.
public final Point

Returns:

this instance for scaling
scale
(final int
scale factor for x
sx
,
final int
scale factor for y
sy
)

Scale this instance's x- and y-components, i.e. multiply them by the given scale factors.

public final Point

Returns:

this instance for scaling
scale
(final float
scale factor for x
sx
,
final float
scale factor for y
sy
)

Scale this instance's x- and y-components, i.e. multiply them by the given scale factors.

public final Point

Returns:

this instance for scaling
scaleInv
(final int
inverse scale factor for x
sx
,
final int
inverse scale factor for y
sy
)

Inverse scale this instance's x- and y-components, i.e. divide them by the given scale factors.

public final Point

Returns:

this instance for scaling
scaleInv
(final float
inverse scale factor for x
sx
,
final float
inverse scale factor for y
sy
)

Inverse scale this instance's x- and y-components, i.e. divide them by the given scale factors.

public final void
set(final int x, final int y)

public final void
setX(final int x)

public final void
setY(final int y)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public final Point

Returns:

this instance for scaling
translate
(final Point
delta point
pd
)

Translate this instance's x- and y-components, i.e. add the values of the given delta point to them.

public final Point

Returns:

this instance for scaling
translate
(final int
delta for x
dx
,
final int
delta for y
dy
)

Translate this instance's x- and y-components, i.e. add the given deltas to them.

Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

xback to summary
pack-priv int x
yback to summary
pack-priv int y

Constructor Detail

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

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

Annotations
@Override
cloneMutableback to summary
public Object cloneMutable()

Implements com.jogamp.common.type.WriteCloneable.cloneMutable.

Doc from com.jogamp.common.type.WriteCloneable.cloneMutable.

Get a mutable clone from this instance.

Annotations
@Override
compareToback to summary
public int compareTo(final PointImmutable d)

Implements com.jogamp.nativewindow.util.PointImmutable.compareTo.

Doc from com.jogamp.nativewindow.util.PointImmutable.compareTo.

Compares the square of the position.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
d:PointImmutable

Doc from java.lang.Comparable.compareTo.

the object to be compared.

Returns:int

Doc from java.lang.Comparable.compareTo.

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
equalsback to summary
public boolean equals(final Object obj)

Overrides java.lang.Object.equals.

Implements com.jogamp.nativewindow.util.PointImmutable.equals.

Doc from com.jogamp.nativewindow.util.PointImmutable.equals.

Checks whether two points objects are equal. Two instances of PointReadOnly are equal if the two components y and x are equal.

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

true if the two points are equal; otherwise false.

Annotations
@Override
getXback to summary
public final int getX()

Implements com.jogamp.nativewindow.util.PointImmutable.getX.

Annotations
@Override
getYback to summary
public final int getY()

Implements com.jogamp.nativewindow.util.PointImmutable.getY.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements com.jogamp.nativewindow.util.PointImmutable.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
scaleback to summary
public final Point scale(final int sx, final int sy)

Scale this instance's x- and y-components, i.e. multiply them by the given scale factors.

Parameters
sx:int

scale factor for x

sy:int

scale factor for y

Returns:Point

this instance for scaling

scaleback to summary
public final Point scale(final float sx, final float sy)

Scale this instance's x- and y-components, i.e. multiply them by the given scale factors.

The product is rounded back to integer.

Parameters
sx:float

scale factor for x

sy:float

scale factor for y

Returns:Point

this instance for scaling

scaleInvback to summary
public final Point scaleInv(final int sx, final int sy)

Inverse scale this instance's x- and y-components, i.e. divide them by the given scale factors.

Parameters
sx:int

inverse scale factor for x

sy:int

inverse scale factor for y

Returns:Point

this instance for scaling

scaleInvback to summary
public final Point scaleInv(final float sx, final float sy)

Inverse scale this instance's x- and y-components, i.e. divide them by the given scale factors.

The product is rounded back to integer.

Parameters
sx:float

inverse scale factor for x

sy:float

inverse scale factor for y

Returns:Point

this instance for scaling

setback to summary
public final void set(final int x, final int y)
setXback to summary
public final void setX(final int x)
setYback to summary
public final void setY(final int y)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
translateback to summary
public final Point translate(final Point pd)

Translate this instance's x- and y-components, i.e. add the values of the given delta point to them.

Parameters
pd:Point

delta point

Returns:Point

this instance for scaling

translateback to summary
public final Point translate(final int dx, final int dy)

Translate this instance's x- and y-components, i.e. add the given deltas to them.

Parameters
dx:int

delta for x

dy:int

delta for y

Returns:Point

this instance for scaling