public class PGpoint extends PGobject implements org.postgresql.util.PGBinaryObject, java.io.Serializable, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
double |
x
The X coordinate of the point
|
double |
y
The Y coordinate of the point
|
Constructor and Description |
---|
PGpoint()
Required by the driver
|
PGpoint(double x,
double y) |
PGpoint(java.lang.String value)
This is called mainly from the other geometric types, when a
point is embedded within their definition.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
This must be overidden to allow comparisons of objects
|
java.lang.String |
getValue()
This must be overidden, to return the value of the object, in the
form required by org.postgresql.
|
int |
hashCode()
Compute hash.
|
int |
lengthInBytes() |
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) |
void |
setLocation(int x,
int y)
Moves the point to the supplied coordinates.
|
void |
setLocation(java.awt.Point p)
Moves the point to the supplied java.awt.Point
refer to java.awt.Point for description of this
|
void |
setValue(java.lang.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.
|
public double x
public double y
public PGpoint(double x, double y)
x
- coordinatey
- coordinatepublic PGpoint(java.lang.String value) throws java.sql.SQLException
value
- Definition of this point in PostgreSQL's syntaxjava.sql.SQLException
public PGpoint()
public void setValue(java.lang.String s) throws java.sql.SQLException
PGobject
public void setByteValue(byte[] b, int offset)
setByteValue
in interface org.postgresql.util.PGBinaryObject
b
- Definition of this point in PostgreSQL's binary syntaxpublic boolean equals(java.lang.Object obj)
PGobject
public int hashCode()
PGobject
public java.lang.String getValue()
PGobject
public int lengthInBytes()
lengthInBytes
in interface org.postgresql.util.PGBinaryObject
public void toBytes(byte[] b, int offset)
toBytes
in interface org.postgresql.util.PGBinaryObject
public void translate(int x, int y)
x
- integer amount to add on the x axisy
- integer amount to add on the y axispublic void translate(double x, double y)
x
- double amount to add on the x axisy
- double amount to add on the y axispublic void move(int x, int y)
x
- integer coordinatey
- integer coordinatepublic void move(double x, double y)
x
- double coordinatey
- double coordinatepublic void setLocation(int x, int y)
x
- integer coordinatey
- integer coordinatePoint
public void setLocation(java.awt.Point p)
p
- Point to move toPoint