Top Description Fields Constructors Methods
javafx.geometry

public Class Dimension2D

extends Object
Class Inheritance
Imports
javafx.beans.NamedArg

A 2D dimension object that contains a width and a height.
Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private int
hash

Cache the hash code to make computing hashes faster.

private double
height

The height of the dimension.

private double
width

The width of the dimension.

Constructor Summary

AccessConstructor and Description
public
Dimension2D(double
the width
width
,
double
the height
height
)

Constructs a Dimension2D with the specified width and height.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this Dimension2D instance is the same as the obj argument; false otherwise
equals
(Object
the reference object with which to compare
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public final double

Returns:

the height of the dimension
getHeight
()

The height of the dimension.

public final double

Returns:

the width of the dimension
getWidth
()

The width of the dimension.

public int

Returns:

a hash code value for the Dimension2D object.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the Dimension2D object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of this Dimension2D.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

hashback to summary
private int hash

Cache the hash code to make computing hashes faster.

heightback to summary
private double height

The height of the dimension.

Default Value
0.0
widthback to summary
private double width

The width of the dimension.

Default Value
0.0

Constructor Detail

Dimension2Dback to summary
public Dimension2D(double width, double height)

Constructs a Dimension2D with the specified width and height.

Parameters
width:double

the width

height:double

the height

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

Parameters
obj:Object

the reference object with which to compare

Returns:boolean

true if this Dimension2D instance is the same as the obj argument; false otherwise

Annotations
@Override
getHeightback to summary
public final double getHeight()

The height of the dimension.

Returns:double

the height of the dimension

getWidthback to summary
public final double getWidth()

The width of the dimension.

Returns:double

the width of the dimension

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the Dimension2D object.

Returns:int

a hash code value for the Dimension2D object.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this Dimension2D. This method is intended to be used only for informational purposes. The content and format of the returned string might vary between implementations. The returned string might be empty but cannot be null.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override