gov.noaa.pmel.util
Class Dimension2D

java.lang.Object
  extended by gov.noaa.pmel.util.Dimension2D

public class Dimension2D
extends java.lang.Object

A class to encapsulate a double width and a height.

Since:
sgt 1.0
Version:
$Revision$, $Date$
Author:
Donald Denbo

Field Summary
 double height
           
 double width
           
 
Constructor Summary
Dimension2D()
           
Dimension2D(double width, double height)
           
 
Method Summary
 boolean equals(Dimension2D d)
          Test for equality.
 double getHeight()
          Returns the height.
 double getWidth()
          Returns the width.
 void setSize(Dimension2D d)
          Set the size to match the specified size.
 void setSize(double width, double height)
          Set the size to the specified width and height.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

height

public double height

width

public double width
Constructor Detail

Dimension2D

public Dimension2D()

Dimension2D

public Dimension2D(double width,
                   double height)
Method Detail

getWidth

public double getWidth()
Returns the width.

Returns:
the width

getHeight

public double getHeight()
Returns the height.

Returns:
the height

setSize

public void setSize(double width,
                    double height)
Set the size to the specified width and height. This method is included for completeness, to parallel the getSize method of Component.

Parameters:
width - the new width
height - the new height

setSize

public void setSize(Dimension2D d)
Set the size to match the specified size. This method is included for completeness, to parallel the getSize method of Component.

Parameters:
d - the new size

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(Dimension2D d)
Test for equality. Both width and height must be equal to be true.