|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.postgresql.util.PGobject
org.postgresql.geometric.PGpoint
public class PGpoint
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.
Field Summary | |
---|---|
double |
x
The X coordinate of the point |
double |
y
The Y coordinate of the point |
Fields inherited from class org.postgresql.util.PGobject |
---|
type, value |
Constructor Summary | |
---|---|
PGpoint()
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. |
Method Summary | |
---|---|
Object |
clone()
This must be overidden to allow the object to be cloned |
boolean |
equals(Object obj)
This must be overidden to allow comparisons of objects |
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()
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 |
setLocation(Point p)
Moves the point to the supplied java.awt.Point refer to java.awt.Point for description of this |
void |
setValue(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. |
Methods inherited from class org.postgresql.util.PGobject |
---|
getType, setType, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double x
public double y
Constructor Detail |
---|
public PGpoint(double x, double y)
x
- coordinatey
- coordinatepublic PGpoint(String value) throws SQLException
value
- Definition of this point in PostgreSQL's syntax
SQLException
- if something goes wrongpublic PGpoint()
Method Detail |
---|
public void setValue(String s) throws SQLException
PGobject
setValue
in class PGobject
s
- Definition of this point in PostgreSQL's syntax
SQLException
- on conversion failurepublic void setByteValue(byte[] b, int offset)
PGBinaryObject
setByteValue
in interface PGBinaryObject
b
- Definition of this point in PostgreSQL's binary syntaxoffset
- the offset in the byte array where object data startspublic boolean equals(Object obj)
PGobject
equals
in class PGobject
obj
- Object to compare with
public int hashCode()
PGobject
hashCode
in class PGobject
Objects
public String getValue()
PGobject
getValue
in class PGobject
public int lengthInBytes()
PGBinaryObject
lengthInBytes
in interface PGBinaryObject
public void toBytes(byte[] b, int offset)
toBytes
in interface 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 storedpublic 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(Point p)
p
- Point to move toPoint
public Object clone() throws CloneNotSupportedException
PGobject
clone
in class PGobject
CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |