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

Variable Index

 o height
The height dimension.
 o width
The width dimension.

Constructor Index

 o DoubleDimension()
Creates an instance of DoubleDimension with a width of zero and a height of zero.
 o DoubleDimension(Dimension)
Creates an instance of DoubleDimension whose width and height are the same as for the specified dimension.
 o DoubleDimension(double, double)
Constructs a DoubleDimension and initializes it to the specified width and specified height.
 o DoubleDimension(DoubleDimension)
Creates an instance of DoubleDimension whose width and height are the same as for the specified dimension.

Method Index

 o equals(Object)
Checks whether two dimension objects have equal values.
 o getApproximation()
Rounds the DoubleDimension to a standard (integer) Dimension
 o hashCode()
Returns the hashcode for this point.
 o setSize(double, double)
Set the size of this DoubleDimension object to the specified width and height.
 o setSize(DoubleDimension)
Set this dimension as specified.
 o toString()
Returns a string that represents this DoubleDimension object's values.

Variables

 o width
 public double width
The width dimension.

 o height
 public double height
The height dimension.

Constructors

 o DoubleDimension
 public DoubleDimension()
Creates an instance of DoubleDimension with a width of zero and a height of zero.

 o 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.
 o 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.
 o 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

Methods

 o setSize
 public void setSize(DoubleDimension d)
Set this dimension as specified.

Parameters:
d - the new size for this DoubleDimension object.
 o 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.
 o getApproximation
 public Dimension getApproximation()
Rounds the DoubleDimension to a standard (integer) Dimension

Returns:
the DoubleDimension rounded to the nearest Dimension
 o hashCode
 public int hashCode()
Returns the hashcode for this point.

Returns:
a hash code for this point.
Overrides:
hashCode in class Object
 o 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
 o 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