|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.awt.geom.Point2D
public abstract class Point2D
Point2D 類別定義表示 (x,y) 坐標空間中位置的點。
此類別是所有存儲 2D 坐標的物件的惟一抽象父級類別。坐標的實際存儲表示形式由子類別決定。
| 巢狀類別摘要 | |
|---|---|
static class |
Point2D.Double
Double 類別以 double 精度定義指定的點。 |
static class |
Point2D.Float
Float 類別以 float 精度定義指定的點。 |
| 建構子摘要 | |
|---|---|
protected |
Point2D()
這是一個無法直接實例化的抽象類別。 |
| 方法摘要 | |
|---|---|
Object |
clone()
創建一個與此物件具有相同類別和相同內容的新物件。 |
double |
distance(double px,
double py)
返回從此 Point2D 到指定點的距離。 |
static double |
distance(double x1,
double y1,
double x2,
double y2)
返回兩個點之間距離。 |
double |
distance(Point2D pt)
返回從此 Point2D 到指定 Point2D 的距離。 |
double |
distanceSq(double px,
double py)
返回從此 Point2D 到指定點的距離的平方。 |
static double |
distanceSq(double x1,
double y1,
double x2,
double y2)
返回兩個點之間距離的平方。 |
double |
distanceSq(Point2D pt)
返回從此 Point2D 到指定 Point2D 的距離的平方。 |
boolean |
equals(Object obj)
確定兩個點是否相等。 |
abstract double |
getX()
以 double 精度返回此 Point2D 的 X 坐標。 |
abstract double |
getY()
以 double 精度返回此 Point2D 的 Y 坐標。 |
int |
hashCode()
返回此 Point2D 的雜湊碼。 |
abstract void |
setLocation(double x,
double y)
將此 Point2D 的位置設為指定的 double 坐標。 |
void |
setLocation(Point2D p)
將此 Point2D 的位置設為指定 Point2D 物件的坐標。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
protected Point2D()
Point2D.Float,
Point2D.Double,
Point| 方法詳細資訊 |
|---|
public abstract double getX()
double 精度返回此 Point2D 的 X 坐標。
Point2D 的 X 坐標。public abstract double getY()
double 精度返回此 Point2D 的 Y 坐標。
Point2D 的 Y 坐標。
public abstract void setLocation(double x,
double y)
Point2D 的位置設為指定的 double 坐標。
x - 此 Point2D 的新 X 坐標y - 此 Point2D 的新 Y 坐標public void setLocation(Point2D p)
Point2D 的位置設為指定 Point2D 物件的坐標。
p - 用於設置此 Point2D 的指定 Point2D
public static double distanceSq(double x1,
double y1,
double x2,
double y2)
x1 - 第一個指定點的 X 坐標y1 - 第一個指定點的 Y 坐標x2 - 第二個指定點的 X 坐標y2 - 第二個指定點的 Y 坐標
public static double distance(double x1,
double y1,
double x2,
double y2)
x1 - 第一個指定點的 X 坐標y1 - 第一個指定點的 Y 坐標x2 - 第二個指定點的 X 坐標y2 - 第二個指定點的 Y 坐標
public double distanceSq(double px,
double py)
Point2D 到指定點的距離的平方。
px - 將對照此 Point2D 進行測量的指定點的 X 坐標py - 將對照此 Point2D 進行測量的指定點的 X 坐標
Point2D 與指定點之間距離的平方。public double distanceSq(Point2D pt)
Point2D 到指定 Point2D 的距離的平方。
將對照此 Point2D 進行測量的指定點的 X 坐標
py - 將對照此 Point2D 進行測量的指定點的 X 坐標
Point2D 與指定點之間的距離。
public double distance(double px,
double py)
Point2D 到指定點的距離。
px - 將對照此 Point2D 進行測量的指定點的 X 坐標py - 將對照此 Point2D 進行測量的指定點的 X 坐標
Point2D 與指定點之間的距離。public double distance(Point2D pt)
Point2D 到指定 Point2D 的距離。
pt - 將對照此 Point2D 進行測量的指定點
Point2D 和指定 Point2D 之間的距離。public Object clone()
Object 中的 cloneOutOfMemoryError - 如果沒有足夠的記憶體。Cloneablepublic int hashCode()
Point2D 的雜湊碼。
Object 中的 hashCodePoint2D 的雜湊碼Object.equals(java.lang.Object),
Hashtablepublic boolean equals(Object obj)
Point2D 的兩個實例的 x 和 y 成員欄位值相同,則它們是相等的,這表示它們在坐標空間中的位置是一樣的。
Object 中的 equalsobj - 要與此 Point2D 的實例進行比較的物件
Point2D 的實例且值相同,則返回 true;否則返回 false。Object.hashCode(),
Hashtable
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。