org.jfree.ui

Class Size2D

Implemented Interfaces:
Cloneable, PublicCloneable, Serializable

public class Size2D
extends java.lang.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

double
height
The height.
double
width
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

Object
clone()
Returns a clone of this object.
boolean
equals(Object obj)
Compares this instance for equality with an arbitrary object.
double
getHeight()
Returns the height.
double
getWidth()
Returns the width.
void
setHeight(double height)
Sets the height.
void
setWidth(double width)
Sets the width.
String
toString()
Returns a string representation of this instance, mostly used for debugging purposes.

Field Details

height

public double height
The height.

width

public double width
The width.

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

clone

public Object clone()
            throws CloneNotSupportedException
Returns a clone of this object.
Specified by:
clone in interface PublicCloneable
Returns:
A clone.

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.