|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttwaver.Point
public class Point
点对象,用于描述二维坐标点信息,包含x,y两个参数
Field Summary | |
---|---|
float |
x
x坐标 |
float |
y
y坐标 |
Constructor Summary | |
---|---|
Point()
点对象,用于描述二维坐标点信息,包含x,y两个参数 |
|
Point(double x,
double y)
构造函数 |
|
Point(float x,
float y)
构造函数 |
|
Point(Point src)
构造函数 |
Method Summary | |
---|---|
static double |
calculateDistance(double x,
double y)
计算坐标点距离原点距离 |
Point |
clone()
拷贝一份新的数据,避免对原始数据的更改 |
void |
deserialize(java.lang.String string)
反序列化属性,根据字符串生成对象的属性 |
double |
distance(double px,
double py)
两点距离 |
double |
distance(Point p2)
两点距离 |
boolean |
equals(float x,
float y)
是否为相同坐标位置 |
boolean |
equals(java.lang.Object o)
|
double |
getDistance()
|
int |
hashCode()
|
boolean |
isEmpty()
|
void |
negate()
取反,正坐标变成负坐标 |
Point |
offset(double dx,
double dy)
偏移坐标 |
Point |
offset(float dx,
float dy)
偏移坐标 |
Point |
offset(Point offset)
偏移坐标 |
java.lang.String |
serialize()
序列化该对象 |
void |
set(double x,
double y)
设置坐标点位置 |
void |
set(float x,
float y)
设置坐标点位置 |
void |
set(Point p)
设置坐标点位置 |
java.lang.String |
toString()
|
Point |
translate(float dx,
float dy)
偏移坐标,与 offset(float, float) 相同 |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public float x
public float y
Constructor Detail |
---|
public Point()
public Point(double x, double y)
x
- x坐标y
- y坐标public Point(float x, float y)
x
- x坐标y
- y坐标public Point(Point src)
src
- 坐标点Method Detail |
---|
public void set(Point p)
p
- 坐位置public void set(float x, float y)
x
- x坐标y
- y坐标public void set(double x, double y)
x
- x坐标y
- y坐标public void negate()
public Point offset(Point offset)
offset
- 偏移量
public Point offset(double dx, double dy)
dx
- x偏移量dy
- y偏移量
public Point offset(float dx, float dy)
dx
- x偏移量dy
- y偏移量
public Point translate(float dx, float dy)
offset(float, float)
相同
dx
- x偏移量dy
- y偏移量
public final boolean equals(float x, float y)
x
- x坐标y
- y坐标
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public double distance(Point p2)
p2
- 另一点
public double distance(double px, double py)
px
- x坐标py
- y坐标
public double getDistance()
public static double calculateDistance(double x, double y)
x
- x坐标y
- y坐标
public boolean isEmpty()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Point clone()
IStruct
clone
in interface IStruct
clone
in class java.lang.Object
public java.lang.String serialize()
ISerializable
serialize
in interface ISerializable
public void deserialize(java.lang.String string)
ISerializable
deserialize
in interface ISerializable
string
- 字符串
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |