パッケージ org.postgresql.geometric

クラス PGpoint

java.lang.Object
org.postgresql.util.PGobject
org.postgresql.geometric.PGpoint
すべての実装されたインタフェース:
Serializable, Cloneable, PGBinaryObject

public class PGpoint extends PGobject implements PGBinaryObject, Serializable, Cloneable

It maps to the point datatype in org.postgresql.

This implements a version of java.awt.Point, except it uses double to represent the coordinates.

関連項目:
  • フィールドの概要

    フィールド
    修飾子とタイプ
    フィールド
    説明
    boolean
    True if the point represents null::point.
    double
    The X coordinate of the point.
    double
    The Y coordinate of the point.

    クラスから継承されたフィールド org.postgresql.util.PGobject

    type, value
  • コンストラクタの概要

    コンストラクタ
    コンストラクタ
    説明
    Required by the driver.
    PGpoint(double x, double y)
     
    PGpoint(String value)
    This is called mainly from the other geometric types, when a point is embedded within their definition.
  • メソッドの概要

    修飾子とタイプ
    メソッド
    説明
    This must be overridden to allow the object to be cloned.
    boolean
    equals(@Nullable Object obj)
    This must be overridden to allow comparisons of objects.
    @Nullable String
    This must be overridden, to return the value of the object, in the form required by org.postgresql.
    int
    Compute hash.
    int
    This method is called to return the number of bytes needed to store this object in the binary form required by org.postgresql.
    void
    move(double x, double y)
    Moves the point to the supplied coordinates.
    void
    move(int x, int y)
    Moves the point to the supplied coordinates.
    void
    setByteValue(byte[] b, int offset)
    This method is called to set the value of this object.
    void
    setLocation(int x, int y)
    Moves the point to the supplied coordinates. refer to java.awt.Point for description of this.
    void
    推奨されていません。
    Will be removed for avoiding a dependency to the java.desktop module.
    void
    setValue(@Nullable String s)
    This method sets the value of this object.
    void
    toBytes(byte[] b, int offset)
    Populate the byte array with PGpoint in the binary syntax expected by org.postgresql.
    void
    translate(double x, double y)
    Translate the point by the supplied amount.
    void
    translate(int x, int y)
    Translate the point by the supplied amount.

    クラスから継承されたメソッド org.postgresql.util.PGobject

    equals, getType, isNull, setType, toString

    クラスから継承されたメソッド java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • フィールド詳細

    • x

      public double x
      The X coordinate of the point.
    • y

      public double y
      The Y coordinate of the point.
    • isNull

      public boolean isNull
      True if the point represents null::point.
  • コンストラクタの詳細

    • PGpoint

      public PGpoint(double x, double y)
      パラメータ:
      x - coordinate
      y - coordinate
    • PGpoint

      public PGpoint(String value) throws SQLException
      This is called mainly from the other geometric types, when a point is embedded within their definition.
      パラメータ:
      value - Definition of this point in PostgreSQL's syntax
      例外:
      SQLException - if something goes wrong
    • PGpoint

      public PGpoint()
      Required by the driver.
  • メソッドの詳細

    • setValue

      public void setValue(@Nullable String s) throws SQLException
      クラスからコピーされた説明: PGobject
      This method sets the value of this object. It must be overridden.
      オーバーライド:
      setValue クラス内 PGobject
      パラメータ:
      s - Definition of this point in PostgreSQL's syntax
      例外:
      SQLException - on conversion failure
    • setByteValue

      public void setByteValue(byte[] b, int offset)
      インタフェースからコピーされた説明: PGBinaryObject
      This method is called to set the value of this object.
      定義:
      setByteValue インタフェース内 PGBinaryObject
      パラメータ:
      b - Definition of this point in PostgreSQL's binary syntax
      offset - the offset in the byte array where object data starts
    • equals

      public boolean equals(@Nullable Object obj)
      クラスからコピーされた説明: PGobject
      This must be overridden to allow comparisons of objects.
      オーバーライド:
      equals クラス内 PGobject
      パラメータ:
      obj - Object to compare with
      戻り値:
      true if the two points are identical
    • hashCode

      public int hashCode()
      クラスからコピーされた説明: PGobject
      Compute hash. As equals() use only value. Return the same hash for the same value.
      オーバーライド:
      hashCode クラス内 PGobject
      戻り値:
      Value hashcode, 0 if value is null Objects.hashCode(Object)
    • getValue

      public @Nullable String getValue()
      クラスからコピーされた説明: PGobject
      This must be overridden, to return the value of the object, in the form required by org.postgresql.
      オーバーライド:
      getValue クラス内 PGobject
      戻り値:
      the PGpoint in the syntax expected by org.postgresql
    • lengthInBytes

      public int lengthInBytes()
      インタフェースからコピーされた説明: PGBinaryObject
      This method is called to return the number of bytes needed to store this object in the binary form required by org.postgresql.
      定義:
      lengthInBytes インタフェース内 PGBinaryObject
      戻り値:
      the number of bytes needed to store this object
    • toBytes

      public void toBytes(byte[] b, int offset)
      Populate the byte array with PGpoint in the binary syntax expected by org.postgresql.
      定義:
      toBytes インタフェース内 PGBinaryObject
      パラメータ:
      b - the array to store the value, it is guaranteed to be at lest PGBinaryObject.lengthInBytes() in size.
      offset - the offset in the byte array where object must be stored
    • translate

      public void translate(int x, int y)
      Translate the point by the supplied amount.
      パラメータ:
      x - integer amount to add on the x axis
      y - integer amount to add on the y axis
    • translate

      public void translate(double x, double y)
      Translate the point by the supplied amount.
      パラメータ:
      x - double amount to add on the x axis
      y - double amount to add on the y axis
    • move

      public void move(int x, int y)
      Moves the point to the supplied coordinates.
      パラメータ:
      x - integer coordinate
      y - integer coordinate
    • move

      public void move(double x, double y)
      Moves the point to the supplied coordinates.
      パラメータ:
      x - double coordinate
      y - double coordinate
    • setLocation

      public void setLocation(int x, int y)
      Moves the point to the supplied coordinates. refer to java.awt.Point for description of this.
      パラメータ:
      x - integer coordinate
      y - integer coordinate
      関連項目:
    • setLocation

      @Deprecated public void setLocation(Point p)
      推奨されていません。
      Will be removed for avoiding a dependency to the java.desktop module.
      Moves the point to the supplied java.awt.Point refer to java.awt.Point for description of this.
      パラメータ:
      p - Point to move to
      関連項目:
    • clone

      public Object clone() throws CloneNotSupportedException
      クラスからコピーされた説明: PGobject
      This must be overridden to allow the object to be cloned.
      オーバーライド:
      clone クラス内 PGobject
      例外:
      CloneNotSupportedException