public class Dimension2DDouble
extends java.awt.geom.Dimension2D
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
double |
height
The height dimension; negative values can be used.
|
double |
width
The width dimension; negative values can be used.
|
Constructor and Description |
---|
Dimension2DDouble()
Creates an instance of
Dimension2DDouble with a width
of zero and a height of zero. |
Dimension2DDouble(Dimension2DDouble d)
Creates an instance of
Dimension2DDouble whose width
and height are the same as for the specified dimension. |
Dimension2DDouble(double width,
double height)
Constructs a
Dimension2DDouble and initializes
it to the specified width and specified height. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Checks whether two dimension objects have equal values.
|
double |
getHeight()
Returns the height of this dimension in double precision.
|
Dimension2DDouble |
getSize()
Gets the size of this
Dimension2DDouble object. |
double |
getWidth()
Returns the width of this dimension in double precision.
|
int |
hashCode()
Returns the hash code for this
Dimension2DDouble . |
void |
setSize(Dimension2DDouble d)
Sets the size of this
Dimension2DDouble object to the specified size. |
void |
setSize(double width,
double height)
Sets the size of this
Dimension2DDouble object to
the specified width and height in double precision. |
java.lang.String |
toString()
Returns a string representation of the values of this
Dimension2DDouble object's height and
width fields. |
public double width
getSize()
,
setSize(double, double)
public double height
getSize()
,
setSize(double, double)
public Dimension2DDouble()
Dimension2DDouble
with a width
of zero and a height of zero.public Dimension2DDouble(Dimension2DDouble d)
Dimension2DDouble
whose width
and height are the same as for the specified dimension.d
- the specified dimension for the
width
and
height
valuespublic Dimension2DDouble(double width, double height)
Dimension2DDouble
and initializes
it to the specified width and specified height.width
- the specified widthheight
- the specified heightpublic double getWidth()
getWidth
in class java.awt.geom.Dimension2D
public double getHeight()
getHeight
in class java.awt.geom.Dimension2D
public void setSize(double width, double height)
Dimension2DDouble
object to
the specified width and height in double precision.
Note that if width
or height
are larger than Integer.MAX_VALUE
, they will
be reset to Integer.MAX_VALUE
.setSize
in class java.awt.geom.Dimension2D
width
- the new width for the Dimension2DDouble
objectheight
- the new height for the Dimension2DDouble
objectpublic Dimension2DDouble getSize()
Dimension2DDouble
object.
This method is included for completeness, to parallel the
getSize
method defined by Component
.Dimension2DDouble
with the same width and heightsetSize(double, double)
,
Component.getSize()
public void setSize(Dimension2DDouble d)
Dimension2DDouble
object to the specified size.
This method is included for completeness, to parallel the
setSize
method defined by Component
.d
- the new size for this Dimension2DDouble
objectgetSize()
,
Component.setSize(int, int)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
Dimension2DDouble
.hashCode
in class java.lang.Object
Dimension2DDouble
public java.lang.String toString()
Dimension2DDouble
object's height
and
width
fields. This method is intended to be used only
for debugging purposes, and the content and format of the returned
string may vary between implementations. The returned string may be
empty but may not be null
.toString
in class java.lang.Object
Dimension2DDouble
object