Packages

 

com.aspose.cad

Class Size

  • java.lang.Object
    • com.aspose.ms.System.ValueType<T>
      • com.aspose.ms.lang.Struct<Size>
        • com.aspose.cad.Size


  • public class Size
    extends com.aspose.ms.lang.Struct<Size>

    Represents size.

    • Constructor Summary

      Constructors 
      Constructor and Description
      Size() 
      Size(int width, int height)
      Initializes a new instance of the com.aspose.cad.Size object from the specified dimensions.
      Size(Point point)
      Initializes a new instance of the com.aspose.cad.Size object from the specified com.aspose.cad.Point.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static Size add(Size size1, Size size2)
      Adds the width and height of one com.aspose.cad.Size object to the width and height of another com.aspose.cad.Size object.
      static Size ceiling(SizeF size)
      Converts the specified com.aspose.cad.SizeF object to a com.aspose.cad.Size object by rounding the values of the com.aspose.cad.Size object to the next higher integer values.
      Object clone() 
      Size Clone() 
      void CloneTo(Size that) 
      boolean equals(Object obj)
      Tests to see whether the specified object is a com.aspose.cad.Size with the same dimensions as this com.aspose.cad.Size.
      static Size getEmpty()
      Gets a new instance of the com.aspose.cad.Size object that has com.aspose.cad.Size.Width and com.aspose.cad.Size.Height values set to zero.
      int getHeight()
      Gets the vertical component of this com.aspose.cad.Size.
      int getWidth()
      Gets the horizontal component of this com.aspose.cad.Size.
      int hashCode()
      Returns a hash code for this com.aspose.cad.Size object.
      boolean isEmpty()
      Gets a value indicating whether this com.aspose.cad.Size has width and height of 0.
      static Size op_Addition(Size size1, Size size2)
      Adds the width and height of one com.aspose.cad.Size object to the width and height of another com.aspose.cad.Size object.
      static boolean op_Equality(Size size1, Size size2)
      Tests whether two com.aspose.cad.Size objects are equal.
      static boolean op_Inequality(Size size1, Size size2)
      Tests whether two com.aspose.cad.Size objects are different.
      static Size op_Subtraction(Size size1, Size size2)
      Subtracts the width and height of one com.aspose.cad.Size object from the width and height of another com.aspose.cad.Size object.
      static Size round(SizeF size)
      Converts the specified com.aspose.cad.SizeF object to a com.aspose.cad.Size object by rounding the values of the com.aspose.cad.SizeF object to the nearest integer values.
      void setHeight(int value)
      Sets the vertical component of this com.aspose.cad.Size.
      void setWidth(int value)
      Sets the horizontal component of this com.aspose.cad.Size.
      static Size subtract(Size size1, Size size2)
      Subtracts the width and height of one com.aspose.cad.Size object from the width and height of another com.aspose.cad.Size object.
      static Point to_Point(Size size)
      Converts the specified com.aspose.cad.Size to a com.aspose.cad.Point.
      static SizeF to_SizeF(Size size)
      Converts the specified com.aspose.cad.Size to a com.aspose.cad.SizeF.
      String toString()
      Creates a human-readable string that represents this com.aspose.cad.Size.
      static Size truncate(SizeF size)
      Converts the specified com.aspose.cad.SizeF object to a com.aspose.cad.Size object by truncating the values of the com.aspose.cad.SizeF object to the next lower integer values.
    • Constructor Detail

      • Size

        public Size()
      • Size

        public Size(Point point)

        Initializes a new instance of the com.aspose.cad.Size object from the specified com.aspose.cad.Point.

        Parameters:
        point - The com.aspose.cad.Point from which to initialize this com.aspose.cad.Size.
      • Size

        public Size(int width,
                    int height)

        Initializes a new instance of the com.aspose.cad.Size object from the specified dimensions.

        Parameters:
        width - The width component of the new com.aspose.cad.Size.
        height - The height component of the new com.aspose.cad.Size.
    • Method Detail

      • getEmpty

        public static Size getEmpty()

        Gets a new instance of the com.aspose.cad.Size object that has com.aspose.cad.Size.Width and com.aspose.cad.Size.Height values set to zero.

        Returns:
        The empty size (width and height are zero)
      • isEmpty

        public boolean isEmpty()

        Gets a value indicating whether this com.aspose.cad.Size has width and height of 0.

        Returns:
        true is size is empty (width and height are zero)
      • getWidth

        public int getWidth()

        Gets the horizontal component of this com.aspose.cad.Size.

        Returns:
        The width
      • setWidth

        public void setWidth(int value)

        Sets the horizontal component of this com.aspose.cad.Size.

        Parameters:
        value - The width
      • getHeight

        public int getHeight()

        Gets the vertical component of this com.aspose.cad.Size.

        Returns:
        The height
      • setHeight

        public void setHeight(int value)

        Sets the vertical component of this com.aspose.cad.Size.

        Parameters:
        value - The new height
      • to_SizeF

        public static SizeF to_SizeF(Size size)

        Converts the specified com.aspose.cad.Size to a com.aspose.cad.SizeF.

        Parameters:
        size - The com.aspose.cad.Size to convert.
        Returns:
        The com.aspose.cad.SizeF object to which this operator converts.
      • op_Addition

        public static Size op_Addition(Size size1,
                                       Size size2)

        Adds the width and height of one com.aspose.cad.Size object to the width and height of another com.aspose.cad.Size object.

        Parameters:
        size1 - The first com.aspose.cad.Size to add.
        size2 - The second com.aspose.cad.Size to add.
        Returns:
        A com.aspose.cad.Size object that is the result of the addition operation.
      • op_Subtraction

        public static Size op_Subtraction(Size size1,
                                          Size size2)

        Subtracts the width and height of one com.aspose.cad.Size object from the width and height of another com.aspose.cad.Size object.

        Parameters:
        size1 - The com.aspose.cad.Size object on the left side of the subtraction operator.
        size2 - The com.aspose.cad.Size object on the right side of the subtraction operator.
        Returns:
        A com.aspose.cad.Size object that is the result of the subtraction operation.
      • op_Equality

        public static boolean op_Equality(Size size1,
                                          Size size2)

        Tests whether two com.aspose.cad.Size objects are equal.

        Parameters:
        size1 - The com.aspose.cad.Size object on the left side of the equality operator.
        size2 - The com.aspose.cad.Size object on the right of the equality operator.
        Returns:
        True if size1 and size2 have equal width and height; otherwise, false.
      • op_Inequality

        public static boolean op_Inequality(Size size1,
                                            Size size2)

        Tests whether two com.aspose.cad.Size objects are different.

        Parameters:
        size1 - The com.aspose.cad.Size object on the left of the inequality operator.
        size2 - The com.aspose.cad.Size object on the right of the inequality operator.
        Returns:
        True if size1 and size2 differ either in width or height; false if size1 and size2 are equal.
      • to_Point

        public static Point to_Point(Size size)

        Converts the specified com.aspose.cad.Size to a com.aspose.cad.Point.

        Parameters:
        size - The com.aspose.cad.Size to convert.
        Returns:
        The com.aspose.cad.Point object to which this operator converts.
      • add

        public static Size add(Size size1,
                               Size size2)

        Adds the width and height of one com.aspose.cad.Size object to the width and height of another com.aspose.cad.Size object.

        Parameters:
        size1 - The first com.aspose.cad.Size to add.
        size2 - The second com.aspose.cad.Size to add.
        Returns:
        A com.aspose.cad.Size object that is the result of the addition operation.
      • ceiling

        public static Size ceiling(SizeF size)

        Converts the specified com.aspose.cad.SizeF object to a com.aspose.cad.Size object by rounding the values of the com.aspose.cad.Size object to the next higher integer values.

        Parameters:
        size - The com.aspose.cad.SizeF object to convert.
        Returns:
        The com.aspose.cad.Size object this method converts to.
      • subtract

        public static Size subtract(Size size1,
                                    Size size2)

        Subtracts the width and height of one com.aspose.cad.Size object from the width and height of another com.aspose.cad.Size object.

        Parameters:
        size1 - The com.aspose.cad.Size object on the left side of the subtraction operator.
        size2 - The com.aspose.cad.Size object on the right side of the subtraction operator.
        Returns:
        The com.aspose.cad.Size that is a result of the subtraction operation.
      • truncate

        public static Size truncate(SizeF size)

        Converts the specified com.aspose.cad.SizeF object to a com.aspose.cad.Size object by truncating the values of the com.aspose.cad.SizeF object to the next lower integer values.

        Parameters:
        size - The com.aspose.cad.SizeF object to convert.
        Returns:
        The com.aspose.cad.Size object this method converts to.
      • round

        public static Size round(SizeF size)

        Converts the specified com.aspose.cad.SizeF object to a com.aspose.cad.Size object by rounding the values of the com.aspose.cad.SizeF object to the nearest integer values.

        Parameters:
        size - The com.aspose.cad.SizeF object to convert.
        Returns:
        The com.aspose.cad.Size object this method converts to.
      • equals

        public boolean equals(Object obj)

        Tests to see whether the specified object is a com.aspose.cad.Size with the same dimensions as this com.aspose.cad.Size.

        Overrides:
        equals in class Object
        Parameters:
        obj - The System.Object to test.
        Returns:
        True if obj is a com.aspose.cad.Size and has the same width and height as this com.aspose.cad.Size; otherwise, false.
      • hashCode

        public int hashCode()

        Returns a hash code for this com.aspose.cad.Size object.

        Overrides:
        hashCode in class Object
        Returns:
        An integer value that specifies a hash value for this com.aspose.cad.Size object.
      • toString

        public String toString()

        Creates a human-readable string that represents this com.aspose.cad.Size.

        Overrides:
        toString in class Object
        Returns:
        A string that represents this com.aspose.cad.Size.
      • CloneTo

        public void CloneTo(Size that)
        Specified by:
        CloneTo in class com.aspose.ms.System.ValueType<Size>
      • Clone

        public Size Clone()
        Specified by:
        Clone in class com.aspose.ms.System.ValueType<Size>