Class FloatDimension
java.lang.Object
java.awt.geom.Dimension2D
org.pentaho.reporting.libraries.base.util.FloatDimension
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class FloatDimension
extends java.awt.geom.Dimension2D
implements java.io.Serializable
A dimension object specified using
float
values.- Author:
- Thomas Morgner
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new dimension object with width and height set to zero.FloatDimension
(float width, float height) Creates a new dimension.Creates a new dimension that is a copy of another dimension. -
Method Summary
Modifier and TypeMethodDescriptionjava.lang.Object
clone()
Creates and returns a copy of this object.boolean
equals
(java.lang.Object o) Tests this object for equality with another object.double
Returns the height.double
getWidth()
Returns the width.int
hashCode()
Returns a hash code.void
setHeight
(double height) Sets the height.void
setSize
(double width, double height) Sets the size of thisDimension
object to the specified width and height.void
setWidth
(double width) Sets the width.java.lang.String
toString()
Returns a string representation of the object.Methods inherited from class java.awt.geom.Dimension2D
setSize
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
FloatDimension
public FloatDimension()Creates a new dimension object with width and height set to zero. -
FloatDimension
Creates a new dimension that is a copy of another dimension.- Parameters:
fd
- the dimension to copy.
-
FloatDimension
public FloatDimension(float width, float height) Creates a new dimension.- Parameters:
width
- the width.height
- the height.
-
-
Method Details
-
getWidth
public double getWidth()Returns the width.- Specified by:
getWidth
in classjava.awt.geom.Dimension2D
- Returns:
- the width.
-
getHeight
public double getHeight()Returns the height.- Specified by:
getHeight
in classjava.awt.geom.Dimension2D
- Returns:
- the height.
-
setWidth
public void setWidth(double width) Sets the width.- Parameters:
width
- the width.
-
setHeight
public void setHeight(double height) Sets the height.- Parameters:
height
- the height.
-
setSize
public void setSize(double width, double height) Sets the size of thisDimension
object to the specified width and height. This method is included for completeness, to parallel thegetSize
method ofComponent
.- Specified by:
setSize
in classjava.awt.geom.Dimension2D
- Parameters:
width
- the new width for theDimension
objectheight
- the new height for theDimension
object
-
clone
public java.lang.Object clone()Creates and returns a copy of this object.- Overrides:
clone
in classjava.awt.geom.Dimension2D
- Returns:
- a clone of this instance.
- See Also:
-
Cloneable
-
toString
public java.lang.String toString()Returns a string representation of the object. In general, thetoString
method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of the object.
-
equals
public boolean equals(java.lang.Object o) Tests this object for equality with another object.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- the other object.- Returns:
true
orfalse
.
-
hashCode
public int hashCode()Returns a hash code.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- A hash code.
-