All Packages Class Hierarchy This Package Previous Next Index
Class att.grappa.DoubleDimension
java.lang.Object
|
+----att.grappa.DoubleDimension
- public class DoubleDimension
- extends Object
- implements Serializable
A re-implementation of java.awt.Dimension using doubles instead of ints.
- Version:
- 1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
- Author:
- John Mocenigo, Research @ AT&T Labs
-
height
- The height dimension.
-
width
- The width dimension.
-
DoubleDimension()
-
Creates an instance of
DoubleDimension with a width
of zero and a height of zero.
-
DoubleDimension(Dimension)
-
Creates an instance of
DoubleDimension whose width
and height are the same as for the specified dimension.
-
DoubleDimension(double, double)
-
Constructs a
DoubleDimension and initializes it to the specified width and
specified height.
-
DoubleDimension(DoubleDimension)
-
Creates an instance of
DoubleDimension whose width
and height are the same as for the specified dimension.
-
equals(Object)
- Checks whether two dimension objects have equal values.
-
getApproximation()
- Rounds the
DoubleDimension to a standard (integer) Dimension
-
hashCode()
- Returns the hashcode for this point.
-
setSize(double, double)
- Set the size of this
DoubleDimension object
to the specified width and height.
-
setSize(DoubleDimension)
- Set this dimension as specified.
-
toString()
- Returns a string that represents this
DoubleDimension object's values.
width
public double width
- The width dimension.
height
public double height
- The height dimension.
DoubleDimension
public DoubleDimension()
- Creates an instance of
DoubleDimension with a width
of zero and a height of zero.
DoubleDimension
public DoubleDimension(DoubleDimension d)
- Creates an instance of
DoubleDimension whose width
and height are the same as for the specified dimension.
- Parameters:
- d - the specified dimension for the
width and
height values.
DoubleDimension
public DoubleDimension(Dimension d)
- Creates an instance of
DoubleDimension whose width
and height are the same as for the specified dimension.
- Parameters:
- d - the specified dimension for the
width and
height values.
DoubleDimension
public DoubleDimension(double width,
double height)
- Constructs a
DoubleDimension and initializes it to the specified width and
specified height.
- Parameters:
- width - the specified width dimension
- height - the specified height dimension
setSize
public void setSize(DoubleDimension d)
- Set this dimension as specified.
- Parameters:
- d - the new size for this
DoubleDimension object.
setSize
public void setSize(double width,
double height)
- Set the size of this
DoubleDimension object
to the specified width and height.
- Parameters:
- width - the new width for this dimnesion.
- height - the new height for this dimension.
getApproximation
public Dimension getApproximation()
- Rounds the
DoubleDimension to a standard (integer) Dimension
- Returns:
- the
DoubleDimension rounded to the nearest Dimension
hashCode
public int hashCode()
- Returns the hashcode for this point.
- Returns:
- a hash code for this point.
- Overrides:
- hashCode in class Object
equals
public boolean equals(Object obj)
- Checks whether two dimension objects have equal values.
Two instances of
DoubleDimension are equal
if the values of their width and height
member fields are the same.
- Returns:
- true if the supplied object equals this object, false otherwise
- Overrides:
- equals in class Object
toString
public String toString()
- Returns a string that represents this
DoubleDimension object's values.
- Returns:
- a string representation of this dimension,
including the values of
width
and height.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index