Package io.github.sebasbaumh.postgis
Class PGgeometrybase
- java.lang.Object
-
- org.postgresql.util.PGobject
-
- io.github.sebasbaumh.postgis.PGgeometrybase
-
- All Implemented Interfaces:
Serializable,Cloneable,org.postgresql.util.PGBinaryObject
- Direct Known Subclasses:
PGgeography,PGgeometry
@NonNullByDefault({PARAMETER,RETURN_TYPE}) public abstract class PGgeometrybase extends org.postgresql.util.PGobject implements org.postgresql.util.PGBinaryObjectA PostgreSQL JDBCPGobjectextension data type modeling a "geo" type. This class serves as a common superclass for classes such asPGgeometryandPGgeographywhich model more specific type semantics.- Author:
- Phillip Ross
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPGgeometrybase(String type)Constructs an instance.protectedPGgeometrybase(String type, Geometry geom)Constructs an instance.protectedPGgeometrybase(String type, String value)Constructs an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)GeometrygetGeometry()Gets the underlyingGeometry.StringgetValue()inthashCode()intlengthInBytes()voidsetByteValue(byte[] value, int offset)voidsetGeometry(Geometry newgeom)Sets the underlyingGeometry.voidsetValue(String value)voidtoBytes(byte[] bytes, int offset)StringtoString()
-
-
-
Field Detail
-
geometry
@Nullable protected Geometry geometry
Underlying geometry.
-
-
Constructor Detail
-
PGgeometrybase
protected PGgeometrybase(String type)
Constructs an instance.- Parameters:
type- type of thisPGobject
-
PGgeometrybase
protected PGgeometrybase(String type, Geometry geom)
Constructs an instance.- Parameters:
type- type of thisPGobjectgeom-Geometry
-
PGgeometrybase
protected PGgeometrybase(String type, String value) throws SQLException
Constructs an instance.- Parameters:
type- type of thisPGobjectvalue- geometry- Throws:
SQLException
-
-
Method Detail
-
equals
public boolean equals(@Nullable Object obj)- Overrides:
equalsin classorg.postgresql.util.PGobject
-
getGeometry
@Nullable public Geometry getGeometry()
Gets the underlyingGeometry.- Returns:
Geometryon success, else null
-
getValue
@Nullable public String getValue()
- Overrides:
getValuein classorg.postgresql.util.PGobject
-
hashCode
public int hashCode()
- Overrides:
hashCodein classorg.postgresql.util.PGobject
-
lengthInBytes
public int lengthInBytes()
- Specified by:
lengthInBytesin interfaceorg.postgresql.util.PGBinaryObject
-
setByteValue
public void setByteValue(byte[] value, int offset) throws SQLException- Specified by:
setByteValuein interfaceorg.postgresql.util.PGBinaryObject- Throws:
SQLException
-
setGeometry
public void setGeometry(@Nullable Geometry newgeom)Sets the underlyingGeometry.- Parameters:
newgeom-Geometry(can be null)
-
setValue
public void setValue(@Nonnull String value) throws SQLException- Overrides:
setValuein classorg.postgresql.util.PGobject- Throws:
SQLException
-
toBytes
public void toBytes(byte[] bytes, int offset)- Specified by:
toBytesin interfaceorg.postgresql.util.PGBinaryObject
-
toString
public String toString()
- Overrides:
toStringin classorg.postgresql.util.PGobject
-
-