Class PGboxbase

    • 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.
    • Method Detail

      • getPrefix

        public abstract 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
      • getPGtype

        public abstract String getPGtype()
        The Postgres type we have (same construct as getPrefix())
        Returns:
        String containing the name of the type for this box.
      • setValue

        public void setValue​(String value)
                      throws SQLException
        Overrides:
        setValue in class org.postgresql.util.PGobject
        Throws:
        SQLException
      • getValue

        public String getValue()
        Overrides:
        getValue in class org.postgresql.util.PGobject
      • toString

        public 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
        Returns:
        String representation of this box
      • 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
      • 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
      • equals

        public boolean equals​(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
        Parameters:
        first - First of two points to be compared
        second - Second of two points to be compared
        Returns:
        true if the points are the same, false otherwise
      • clone

        public Object clone()
        Overrides:
        clone in class org.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