public class Point extends Object implements Cloneable, PointImmutable
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
Object |
cloneMutable() |
int |
compareTo(PointImmutable d)
Compares the square of the position.
|
boolean |
equals(Object obj)
Checks whether two points objects are equal.
|
int |
getX() |
int |
getY() |
int |
hashCode() |
Point |
scale(int sx,
int sy)
Scale this instance's x- and y-components,
i.e.
|
Point |
scaleInv(int sx,
int sy)
Inverse scale this instance's x- and y-components,
i.e.
|
void |
set(int x,
int y) |
void |
setX(int x) |
void |
setY(int y) |
String |
toString() |
Point |
translate(int dx,
int dy)
Translate this instance's x- and y-components,
i.e.
|
Point |
translate(Point pd)
Translate this instance's x- and y-components,
i.e.
|
public Object cloneMutable()
cloneMutable
in interface WriteCloneable
public int compareTo(PointImmutable d)
PointImmutable
Compares the square of the position.
compareTo
in interface Comparable<PointImmutable>
compareTo
in interface PointImmutable
public boolean equals(Object obj)
PointImmutable
PointReadOnly
are equal if the two components
y
and x
are equal.equals
in interface PointImmutable
equals
in class Object
true
if the two points are equal;
otherwise false
.public final int getX()
getX
in interface PointImmutable
public final int getY()
getY
in interface PointImmutable
public int hashCode()
hashCode
in interface PointImmutable
hashCode
in class Object
public final void set(int x, int y)
public final void setX(int x)
public final void setY(int y)
public final Point translate(Point pd)
pd
- delta pointpublic final Point translate(int dx, int dy)
dx
- delta for xdy
- delta for ypublic final Point scale(int sx, int sy)
sx
- scale factor for xsy
- scale factor for ypublic final Point scaleInv(int sx, int sy)
sx
- inverse scale factor for xsy
- inverse scale factor for yCopyright 2010 JogAmp Community.