org.postgis
Class PGboxbase

java.lang.Object
  extended by org.postgresql.util.PGobject
      extended by org.postgis.PGboxbase
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
PGbox2d, PGbox3d

public abstract class PGboxbase
extends org.postgresql.util.PGobject

See Also:
Serialized Form

Field Summary
protected  Point llb
          The lower left bottom corner of the box.
protected  Point urt
          The upper right top corner of the box.
 
Fields inherited from class org.postgresql.util.PGobject
type, value
 
Constructor Summary
PGboxbase()
           
PGboxbase(Point llb, Point urt)
           
PGboxbase(java.lang.String value)
           
 
Method Summary
 java.lang.Object clone()
           
protected static boolean compareLazyDim(Point first, Point second)
          Compare two coordinates with lazy dimension checking.
 boolean equals(java.lang.Object other)
           
 Point getLLB()
          Returns the lower left bottom corner of the box as a Point object
abstract  java.lang.String getPGtype()
          The Postgres type we have (same construct as getPrefix())
abstract  java.lang.String getPrefix()
          The Prefix we have in WKT rep.
 Point getURT()
          Returns the upper right top corner of the box as a Point object
 java.lang.String getValue()
           
protected abstract  PGboxbase newInstance()
          We could have used this.getClass().newInstance() here, but this forces us dealing with InstantiationException and IllegalAccessException.
 void setValue(java.lang.String value)
           
 java.lang.String toString()
          Unlike geometries, toString() does _not_ contain the srid, as server-side PostGIS cannot parse this.
 
Methods inherited from class org.postgresql.util.PGobject
getType, setType
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

llb

protected Point llb
The lower left bottom corner of the box.


urt

protected Point urt
The upper right top corner of the box.

Constructor Detail

PGboxbase

public PGboxbase()

PGboxbase

public PGboxbase(Point llb,
                 Point urt)

PGboxbase

public PGboxbase(java.lang.String value)
          throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

getPrefix

public 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.


getPGtype

public abstract java.lang.String getPGtype()
The Postgres type we have (same construct as getPrefix())


setValue

public void setValue(java.lang.String value)
              throws java.sql.SQLException
Overrides:
setValue in class org.postgresql.util.PGobject
Throws:
java.sql.SQLException

getValue

public java.lang.String getValue()
Overrides:
getValue in class org.postgresql.util.PGobject

toString

public java.lang.String toString()
Unlike geometries, toString() does _not_ contain the srid, as server-side PostGIS cannot parse this.

Overrides:
toString in class org.postgresql.util.PGobject

getLLB

public Point getLLB()
Returns the lower left bottom corner of the box as a Point object


getURT

public Point getURT()
Returns the upper right top corner of the box as a Point object


equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class org.postgresql.util.PGobject

compareLazyDim

protected static boolean compareLazyDim(Point first,
                                        Point second)
Compare two coordinates with lazy dimension checking. As the Server always returns Box3D with three dimensions, z==0 equals dimensions==2


clone

public java.lang.Object clone()
Overrides:
clone in class org.postgresql.util.PGobject

newInstance

protected abstract PGboxbase newInstance()
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.