Module platform

Class Size2D

java.lang.Object
org.jfree.chart.ui.Size2D
All Implemented Interfaces:
Serializable, Cloneable, PublicCloneable

public class Size2D extends Object implements Cloneable, PublicCloneable, Serializable
A simple class for representing the dimensions of an object. It would be better to use Dimension2D, but this class is broken on various JDK releases (particularly JDK 1.3.1, refer to bugs 4189446 and 4976448 on the Java bug parade).
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
    The height.
    double
    The width.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance with zero width and height.
    Size2D(double width, double height)
    Creates a new instance with the specified width and height.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a clone of this object.
    boolean
    Compares this instance for equality with an arbitrary object.
    double
    Returns the height.
    double
    Returns the width.
    int
     
    void
    setHeight(double height)
    Sets the height.
    void
    setWidth(double width)
    Sets the width.
    Returns a string representation of this instance, mostly used for debugging purposes.

    Methods inherited from class java.lang.Object

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

    • width

      public double width
      The width.
    • height

      public double height
      The height.
  • Constructor Details

    • Size2D

      public Size2D()
      Creates a new instance with zero width and height.
    • Size2D

      public Size2D(double width, double height)
      Creates a new instance with the specified width and height.
      Parameters:
      width - the width.
      height - the height.
  • Method Details

    • getWidth

      public double getWidth()
      Returns the width.
      Returns:
      The width.
    • setWidth

      public void setWidth(double width)
      Sets the width.
      Parameters:
      width - the width.
    • getHeight

      public double getHeight()
      Returns the height.
      Returns:
      The height.
    • setHeight

      public void setHeight(double height)
      Sets the height.
      Parameters:
      height - the height.
    • toString

      public String toString()
      Returns a string representation of this instance, mostly used for debugging purposes.
      Overrides:
      toString in class Object
      Returns:
      A string.
    • equals

      public boolean equals(Object obj)
      Compares this instance for equality with an arbitrary object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.
    • hashCode

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

      public Object clone() throws CloneNotSupportedException
      Returns a clone of this object.
      Specified by:
      clone in interface PublicCloneable
      Overrides:
      clone in class Object
      Returns:
      A clone.
      Throws:
      CloneNotSupportedException - if the object cannot be cloned.