org.jfree.ui

Class Size2D

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).

Author: David Gilbert

Field Summary
doubleheight
The height.
doublewidth
The width.
Constructor Summary
Size2D()
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
Objectclone()
Returns a clone of this object.
booleanequals(Object obj)
Compares this instance for equality with an arbitrary object.
doublegetHeight()
Returns the height.
doublegetWidth()
Returns the width.
voidsetHeight(double height)
Sets the height.
voidsetWidth(double width)
Sets the width.
StringtoString()
Returns a string representation of this instance, mostly used for debugging purposes.

Field Detail

height

public double height
The height.

width

public double width
The width.

Constructor Detail

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 Detail

clone

public Object clone()
Returns a clone of this object.

Returns: A clone.

Throws: CloneNotSupportedException if the object cannot be cloned.

equals

public boolean equals(Object obj)
Compares this instance for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getHeight

public double getHeight()
Returns the height.

Returns: The height.

getWidth

public double getWidth()
Returns the width.

Returns: The width.

setHeight

public void setHeight(double height)
Sets the height.

Parameters: height the height.

setWidth

public void setWidth(double width)
Sets the width.

Parameters: width the width.

toString

public String toString()
Returns a string representation of this instance, mostly used for debugging purposes.

Returns: A string.