com.supermap.data

Class Size2D

  • java.lang.Object
    • com.supermap.data.Size2D


  • public class Size2D
    extends java.lang.Object

    Stores a pair of float values orderly.

    • Constructor Summary

      Constructors 
      Constructor and Description
      Size2D()
      Construct a new Size2D object, both the width and height of it are -1.7976931348623157e+308.
      Size2D(double width, double height)
      Creates a new Size2D object according to the specified arguments.
      Size2D(Size2D sz)
      Constructs a new object identical to the given Size2D object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static Size2D ceiling(Size2D sz)
      Returns a new Size2D object, whose width and height is larger than or equal to the minimum integral value of the corresponding value of the given Size2D object, for example, if the given object is Size2D(2.3,6.8), the created object will be Size2D(3,7).
      Size2D clone()
      Returns a copy of the current Size2D object.
      boolean equals(java.lang.Object obj)
      Whether this Size2D object contain the same width and height with the given Object.
      boolean equals(Size2D sz)
      Determines whether this Size2D object equals to the given Size2D object, that is whether they have the same coordinate.
      static Size2D floor(Size2D sz)
      Returns a new Size2D object, whose width and height is less than or equal to the maximum integral value of the corresponding value of the given Size2D object, for example, if the given object is Size2D(2.3,6.8), the created object will be Size2D(2,6).
      static Size2D getEMPTY()
      Represent a empty read-only Size2D object, that is the widh and height values are both -1.7976931348623157e+308.
      double getHeight()
      Return the height of the Size2D.
      double getWidth()
      Return the width of the Size2D.
      int hashCode()
      Returns the hash code of this Size2D.
      boolean isEmpty()
      Determines whether the current Size2D object are empty, that is the width and height of it are both -1.7976931348623157e+308.
      static Size2D round(Size2D sz)
      Returns a new Size2D object, whose width and height is the value got by round off the corresponding value of the given Size2D object, for example, if the given object is Size2D(2.3,6.8), the created object will be Size2D(2,7).
      void setHeight(double height)
      Sets the height of the Size2D.
      void setWidth(double width)
      Sets the width of the Size2D.
      java.lang.String toString()
      Retrieves a string that indicates the width and height of this Size2D, and the format is "Width=,Height=".
      • Methods inherited from class java.lang.Object

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

      • Size2D

        public Size2D()
        Construct a new Size2D object, both the width and height of it are -1.7976931348623157e+308.
      • Size2D

        public Size2D(double width,
                      double height)
        Creates a new Size2D object according to the specified arguments.
        Parameters:
        width - used to specify the width of Size2D.
        height - used to specify the height of Size2D.
      • Size2D

        public Size2D(Size2D sz)
        Constructs a new object identical to the given Size2D object.
        Parameters:
        sz - the given Size2D object.
    • Method Detail

      • getEMPTY

        public static final Size2D getEMPTY()
        Represent a empty read-only Size2D object, that is the widh and height values are both -1.7976931348623157e+308.
        Returns:
        an empty Size2D object.
      • isEmpty

        public boolean isEmpty()
        Determines whether the current Size2D object are empty, that is the width and height of it are both -1.7976931348623157e+308.
        Returns:
        returns true if the Size2D object is empty.
        Default:
        true, that is the width and the height of the current Size2D object are both -1.7976931348623157e+308.
      • getHeight

        public double getHeight()
        Return the height of the Size2D.
        Returns:
        the height of Size2D.
        Default:
        The default value is -1.7976931348623157e+308
      • setHeight

        public void setHeight(double height)
        Sets the height of the Size2D.
        Parameters:
        height - the height of Size2D.
      • getWidth

        public double getWidth()
        Return the width of the Size2D.
        Returns:
        the width of Size2D.
        Default:
        The default value is -1.7976931348623157e+308
      • setWidth

        public void setWidth(double width)
        Sets the width of the Size2D.
        Parameters:
        width - the width of Size2D.
      • equals

        public boolean equals(Size2D sz)
        Determines whether this Size2D object equals to the given Size2D object, that is whether they have the same coordinate. Note that the comparison is performed in terms of the equal-zero precision. For more information about equal-zero precision, please refer to the Environment class.
        Parameters:
        sz - The object to be tested.
        Returns:
        True if current Size2D equals the specified Size2D. Otherwise, the method returns False.
      • floor

        public static Size2D floor(Size2D sz)
        Returns a new Size2D object, whose width and height is less than or equal to the maximum integral value of the corresponding value of the given Size2D object, for example, if the given object is Size2D(2.3,6.8), the created object will be Size2D(2,6).
        Parameters:
        sz - the Size2D to convert.
        Returns:
        a Size2D object.
      • ceiling

        public static Size2D ceiling(Size2D sz)
        Returns a new Size2D object, whose width and height is larger than or equal to the minimum integral value of the corresponding value of the given Size2D object, for example, if the given object is Size2D(2.3,6.8), the created object will be Size2D(3,7).
        Parameters:
        sz - the Size2D to convert.
        Returns:
        a Size2D object.
      • round

        public static Size2D round(Size2D sz)
        Returns a new Size2D object, whose width and height is the value got by round off the corresponding value of the given Size2D object, for example, if the given object is Size2D(2.3,6.8), the created object will be Size2D(2,7).
        Parameters:
        sz - the Size2D to convert.
        Returns:
        a Size2D object.
      • toString

        public java.lang.String toString()
        Retrieves a string that indicates the width and height of this Size2D, and the format is "Width=,Height=".
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string that represents this Size2D.
      • clone

        public Size2D clone()
        Returns a copy of the current Size2D object.
        Overrides:
        clone in class java.lang.Object
        Returns:
        The new Size2D object generated from the clone operation.
      • equals

        public boolean equals(java.lang.Object obj)
        Whether this Size2D object contain the same width and height with the given Object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - The object to be tested.
        Returns:
        a boolean, if obj is Size2D and has the same width and height with this Size2D object, return true.
      • hashCode

        public int hashCode()
        Returns the hash code of this Size2D.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code of this Size2D.