[]
        
(Showing Draft Content)

Size

Class Size

java.lang.Object
com.grapecity.documents.excel.Size

public class Size extends Object
Represents a two-dimensional size defined by width and height values.

Use this class to store or pass width and height measurements together. Both dimensions are represented as double values and can be accessed through getWidth(), getHeight(), setWidth(double), and setHeight(double).


 Size size = new Size(120.0, 80.0);
 double width = size.getWidth();
 double height = size.getHeight();
 
  • Constructor Summary

    Constructors
    Constructor
    Description
    Size(double width, double height)
    Constructs a new instance of the Size class with the specified width and height.
  • Method Summary

    Modifier and Type
    Method
    Description
    final double
    Gets the height of this size.
    final double
    Gets the width of this size.
    final void
    setHeight(double value)
    Sets the height of this size.
    final void
    setWidth(double value)
    Sets the width of this size.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Size

      public Size(double width, double height)
      Constructs a new instance of the Size class with the specified width and height.

      Use this constructor to create a two-dimensional size whose dimensions can be accessed through getWidth() and getHeight().

      Parameters:
      width - The width of the size.
      height - The height of the size.
  • Method Details

    • getWidth

      public final double getWidth()
      Gets the width of this size.

      Use this method to retrieve the width component of a Size instance.

      
       Size size = new Size(120.0, 80.0);
       double width = size.getWidth();
       
      Returns:
      The width of this size.
    • setWidth

      public final void setWidth(double value)
      Sets the width of this size.

      Use this method to update the width component of a Size instance.

      
       Size size = new Size(120.0, 80.0);
       size.setWidth(100.0);
       
      Parameters:
      value - The width of this size.
    • getHeight

      public final double getHeight()
      Gets the height of this size.

      Use this method to retrieve the height component of a Size instance.

      
       Size size = new Size(120.0, 80.0);
       double height = size.getHeight();
       
      Returns:
      The height of this size.
    • setHeight

      public final void setHeight(double value)
      Sets the height of this size.

      Use this method to update the height component of a Size instance.

      
       Size size = new Size(120.0, 80.0);
       size.setHeight(100.0);
       
      Parameters:
      value - The height of this size.