Class PGbox2d

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class PGbox2d
    extends PGboxbase
    BOX2D representing the maximum extents of the geometry.
    Author:
    Sebastian Baumhekel
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class org.postgresql.util.PGobject

        type, value
    • Constructor Summary

      Constructors 
      Constructor Description
      PGbox2d()
      Constructs an instance.
      PGbox2d​(Point llb, Point urt)
      Constructs an instance.
      PGbox2d​(java.lang.String value)
      Constructs an instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getPGtype()
      The Postgres type we have (same construct as getPrefix())
      java.lang.String getPrefix()
      The Prefix we have in WKT rep.
      protected 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.
      void setValue​(java.lang.String value)  
      • Methods inherited from class org.postgresql.util.PGobject

        getType, hashCode, setType
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PGbox2d

        public PGbox2d()
        Constructs an instance.
      • PGbox2d

        public PGbox2d​(Point llb,
                       Point urt)
        Constructs an instance.
        Parameters:
        llb - lower-left point
        urt - upper-right point
      • PGbox2d

        public PGbox2d​(java.lang.String value)
                throws java.sql.SQLException
        Constructs an instance.
        Parameters:
        value - WKT
        Throws:
        java.sql.SQLException
    • Method Detail

      • getPGtype

        public java.lang.String getPGtype()
        Description copied from class: PGboxbase
        The Postgres type we have (same construct as getPrefix())
        Specified by:
        getPGtype in class PGboxbase
        Returns:
        String containing the name of the type for this box.
      • getPrefix

        public java.lang.String getPrefix()
        Description copied from class: PGboxbase
        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.
        Specified by:
        getPrefix in class PGboxbase
        Returns:
        the prefix, as a string
      • newInstance

        protected PGboxbase newInstance()
        Description copied from class: PGboxbase
        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.
        Specified by:
        newInstance in class PGboxbase
        Returns:
        a new instance of PGboxbase
      • setValue

        public void setValue​(java.lang.String value)
                      throws java.sql.SQLException
        Overrides:
        setValue in class PGboxbase
        Throws:
        java.sql.SQLException