public class RedshiftPoint extends RedshiftObject implements RedshiftBinaryObject, Serializable, Cloneable
It maps to the point datatype in com.amazon.redshift.
This implements a version of java.awt.Point, except it uses double to represent the coordinates.
| Modifier and Type | Field and Description |
|---|---|
double |
x
The X coordinate of the point.
|
double |
y
The Y coordinate of the point.
|
type, value| Constructor and Description |
|---|
RedshiftPoint()
Required by the driver.
|
RedshiftPoint(double x,
double y) |
RedshiftPoint(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 |
|---|---|
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
com.amazon.redshift.
|
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 com.amazon.redshift.
|
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.
|
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 RedshiftPoint in the binary syntax expected by com.amazon.redshift.
|
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.
|
getType, setType, toStringpublic double x
public double y
public RedshiftPoint(double x,
double y)
x - coordinatey - coordinatepublic RedshiftPoint(String value) throws SQLException
value - Definition of this point in Redshift's syntaxSQLException - if something goes wrongpublic RedshiftPoint()
public void setValue(String s) throws SQLException
RedshiftObjectsetValue in class RedshiftObjects - Definition of this point in Redshift's syntaxSQLException - on conversion failurepublic void setByteValue(byte[] b,
int offset)
RedshiftBinaryObjectsetByteValue in interface RedshiftBinaryObjectb - Definition of this point in Redshift's binary syntaxoffset - the offset in the byte array where object data startspublic boolean equals(Object obj)
RedshiftObjectequals in class RedshiftObjectobj - Object to compare withpublic int hashCode()
RedshiftObjecthashCode in class RedshiftObjectObjects.hashCode(Object)public String getValue()
RedshiftObjectgetValue in class RedshiftObjectpublic int lengthInBytes()
RedshiftBinaryObjectlengthInBytes in interface RedshiftBinaryObjectpublic void toBytes(byte[] b,
int offset)
toBytes in interface RedshiftBinaryObjectb - the array to store the value, it is guaranteed to be at lest
RedshiftBinaryObject.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 coordinatePointpublic void setLocation(Point p)
p - Point to move toPointpublic Object clone() throws CloneNotSupportedException
RedshiftObjectclone in class RedshiftObjectCloneNotSupportedExceptionCopyright © 2024 Amazon.com Inc.. All rights reserved.