Package io.github.sebasbaumh.postgis
Class PGboxbase
- java.lang.Object
-
- org.postgresql.util.PGobject
-
- io.github.sebasbaumh.postgis.PGboxbase
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public abstract class PGboxbase extends org.postgresql.util.PGobjectBase class for bounding boxes.- Author:
- Sebastian Baumhekel
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()booleanequals(java.lang.Object obj)PointgetLLB()Returns the lower left bottom corner of the box as a Point objectabstract java.lang.StringgetPGtype()The Postgres type we have (same construct as getPrefix())protected abstract java.lang.StringgetPrefix()The Prefix we have in WKT rep.PointgetURT()Returns the upper right top corner of the box as a Point objectjava.lang.StringgetValue()protected abstract PGboxbasenewInstance()Obtain a new instance of a PGboxbase We could have used this.getClass().newInstance() here, but this forces us dealing with InstantiationException and IllegalAccessException.voidsetValue(java.lang.String value)java.lang.StringtoString()Unlike geometries, toString() does _not_ contain the srid, as server-side PostGIS cannot parse this.
-
-
-
Constructor Detail
-
PGboxbase
protected PGboxbase()
Constructs an instance.
-
PGboxbase
protected PGboxbase(java.lang.String value) throws java.sql.SQLExceptionConstructs an instance.- Parameters:
value- WKT- Throws:
java.sql.SQLException
-
-
Method Detail
-
clone
public java.lang.Object clone()
- Overrides:
clonein classorg.postgresql.util.PGobject
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classorg.postgresql.util.PGobject
-
getLLB
public Point getLLB()
Returns the lower left bottom corner of the box as a Point object- Returns:
- lower left bottom corner of this box
-
getPGtype
public abstract java.lang.String getPGtype()
The Postgres type we have (same construct as getPrefix())- Returns:
- String containing the name of the type for this box.
-
getPrefix
protected abstract java.lang.String getPrefix()
The Prefix we have in WKT rep. I use an abstract method here so we do not need to replicate the String object in every instance.- Returns:
- the prefix, as a string
-
getURT
public Point getURT()
Returns the upper right top corner of the box as a Point object- Returns:
- upper right top corner of this box
-
getValue
public java.lang.String getValue()
- Overrides:
getValuein classorg.postgresql.util.PGobject
-
newInstance
protected abstract PGboxbase newInstance()
Obtain a new instance of a PGboxbase We could have used this.getClass().newInstance() here, but this forces us dealing with InstantiationException and IllegalAccessException. Due to the PGObject.clone() brokennes that does not allow clone() to throw CloneNotSupportedException, we cannot even pass this exceptions down to callers in a sane way.- Returns:
- a new instance of PGboxbase
-
setValue
public void setValue(java.lang.String value) throws java.sql.SQLException- Overrides:
setValuein classorg.postgresql.util.PGobject- Throws:
java.sql.SQLException
-
toString
public java.lang.String toString()
Unlike geometries, toString() does _not_ contain the srid, as server-side PostGIS cannot parse this.- Overrides:
toStringin classorg.postgresql.util.PGobject- Returns:
- String representation of this box
-
-