Class Dimension

java.lang.Object
com.vaadin.featurepack.desktop.geometry.Dimension
All Implemented Interfaces:
Serializable

public class Dimension extends Object implements Serializable
A class that represents a dimension in 2D space.
Author:
Vaadin Ltd
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
     
    int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new dimension with width and height set to 0.
    Dimension(double width, double height)
    Creates a new dimension with the given width and height.
    Dimension(int width, int height)
    Creates a new dimension with the given width and height.
    Creates a new dimension clone
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    Returns the height of this dimension.
    int
    Returns the width of this dimension.
    int
     
    void
    setHeight(int height)
     
    void
    setWidth(int width)
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • width

      public int width
    • height

      public int height
  • Constructor Details

    • Dimension

      public Dimension()
      Creates a new dimension with width and height set to 0.
    • Dimension

      public Dimension(int width, int height)
      Creates a new dimension with the given width and height.
    • Dimension

      public Dimension(double width, double height)
      Creates a new dimension with the given width and height.
    • Dimension

      public Dimension(Dimension dim)
      Creates a new dimension clone
  • Method Details

    • getWidth

      public int getWidth()
      Returns the width of this dimension.
      Returns:
      the width
    • getHeight

      public int getHeight()
      Returns the height of this dimension.
      Returns:
      the height
    • setWidth

      public void setWidth(int width)
    • setHeight

      public void setHeight(int height)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object