public class Dimension
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
height
Area height.
|
double |
width
Area width.
|
Constructor and Description |
---|
Dimension(double width,
double height)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Dimension |
copy()
Create a copy of this dimension object.
|
Dimension |
enlargedBy(Insets insets)
Increase dimension by width and height deltas from provided
Insets instance. |
boolean |
equals(java.lang.Object o)
Checks whether
o represents a Dimension with same values. |
int |
hashCode()
Returns a hash code value for the object.
|
double |
height()
Get dimension height.
|
Dimension |
reducedBy(Insets insets)
Reduce dimension by width and height deltas from provided
Insets instance. |
java.lang.String |
toString()
Returns a string representation of the object.
|
double |
width()
Get dimension width.
|
public Dimension(double width, double height)
width
- Area width.height
- Area height.public Dimension copy()
public Dimension enlargedBy(Insets insets)
Insets
instance.insets
- Source insets.public Dimension reducedBy(Insets insets)
Insets
instance.insets
- Source insets.public double height()
public double width()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
o
represents a Dimension
with same values.equals
in class java.lang.Object
o
- Another object to test for equality.true
if the object passed in represents a Dimension
with same
values for height
and width
.public int hashCode()
Object.hashCode()
for further
information.hashCode
in class java.lang.Object