public abstract class Point2D extends Object implements Cloneable
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) |
2つの点の間の距離を返します。
|
double |
distance(Point2D pt) |
この
Point2Dから指定されたPoint2Dまでの距離を返します。 |
double |
distanceSq(double px, double py) |
この
Point2Dから指定された点までの距離の2乗を返します。 |
static double |
distanceSq(double x1, double y1, double x2, double y2) |
2つの点の間の距離の2乗を返します。
|
double |
distanceSq(Point2D pt) |
この
Point2Dから指定されたPoint2Dまでの距離の2乗を返します。 |
boolean |
equals(Object obj) |
2つの点が等しいかどうかを判定します。
|
abstract double |
getX() |
この
Point2DのX座標をdouble精度で返します。 |
abstract double |
getY() |
この
Point2DのY座標をdouble精度で返します。 |
int |
hashCode() |
この
Point2Dのハッシュ・コードを返します。 |
abstract void |
setLocation(double x, double y) |
この
Point2Dの位置を、指定されたdouble型の座標に設定します。 |
void |
setLocation(Point2D p) |
この
Point2Dの位置を、指定されたPoint2Dオブジェクトと同じ座標に設定します。 |
protected Point2D()
Point2D.Float, Point2D.Double, Pointpublic abstract double getX()
Point2DのX座標をdouble精度で返します。Point2DのX座標。public abstract double getY()
Point2DのY座標をdouble精度で返します。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の設定先の指定されたPoint2Dpublic static double distanceSq(double x1,
double y1,
double x2,
double y2)
x1 - 最初に指定された点のX座標y1 - 最初に指定された点のY座標x2 - 2番目に指定された点のX座標y2 - 2番目に指定された点のY座標public static double distance(double x1,
double y1,
double x2,
double y2)
x1 - 最初に指定された点のX座標y1 - 最初に指定された点のY座標x2 - 2番目に指定された点のX座標y2 - 2番目に指定された点のY座標public double distanceSq(double px,
double py)
Point2Dから指定された点までの距離の2乗を返します。px - Point2Dに対して測定される、指定された点のX座標py - Point2Dに対して測定される、指定された点のY座標Point2Dと指定された点の間の距離の2乗。public double distanceSq(Point2D pt)
Point2Dから指定されたPoint2Dまでの距離の2乗を返します。pt - Point2Dに対して測定される、指定された点Point2Dから指定されたPoint2Dまでの間の距離の2乗。public double distance(double px,
double py)
Point2Dから指定された点までの距離を返します。px - Point2Dに対して測定される、指定された点のX座標py - Point2Dに対して測定される、指定された点のY座標Point2Dと指定された点の間の距離。public double distance(Point2D pt)
Point2Dから指定されたPoint2Dまでの距離を返します。pt - Point2Dに対して測定される、指定された点Point2Dと指定されたPoint2Dの間の距離。public Object clone()
clone、クラスObjectOutOfMemoryError - 十分なメモリーがない場合。Cloneablepublic int hashCode()
Point2Dのハッシュ・コードを返します。hashCode、クラスObjectPoint2Dのハッシュ・コード。Object.equals(java.lang.Object), System.identityHashCode(java.lang.Object)public boolean equals(Object obj)
Point2Dの2つのインスタンスは、xおよびyメンバー・フィールド(座標空間でそれらの位置を表す)の値が同じ場合に等しくなります。 equals、クラスObjectobj - このPoint2Dと比較されるオブジェクトPoint2Dのインスタンスであり、同じ値を持つ場合はtrue、それ以外の場合はfalse。Object.hashCode()、HashMap バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。