org.epseelon.mobimap.geom
Class Dimension2D

java.lang.Object
  extended by org.epseelon.mobimap.geom.Dimension2D
Direct Known Subclasses:
Dimension

public abstract class Dimension2D
extends java.lang.Object

This stores a dimension in 2-dimensional space - a width (along the x-axis) and height (along the y-axis). The storage is left to subclasses.

Since:
1.2
Author:
Per Bothner (bothner@cygnus.com), Eric Blake (ebb9@email.byu.edu)

Constructor Summary
protected Dimension2D()
          The default constructor.
 
Method Summary
abstract  double getHeight()
          Get the height of this dimension.
abstract  double getWidth()
          Get the width of this dimension.
 void setSize(Dimension2D d)
          Set the size of this dimension to the requested value.
abstract  void setSize(double w, double h)
          Set the size of this dimension to the requested values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dimension2D

protected Dimension2D()
The default constructor.

Method Detail

getWidth

public abstract double getWidth()
Get the width of this dimension. A negative result, while legal, is undefined in meaning.

Returns:
the width

getHeight

public abstract double getHeight()
Get the height of this dimension. A negative result, while legal, is undefined in meaning.

Returns:
the height

setSize

public abstract void setSize(double w,
                             double h)
Set the size of this dimension to the requested values. Loss of precision may occur.

Parameters:
w - the new width
h - the new height

setSize

public void setSize(Dimension2D d)
Set the size of this dimension to the requested value. Loss of precision may occur.

Parameters:
d - the dimension containing the new values
Throws:
java.lang.NullPointerException - if d is null


Copyright © 2008 Epseelon. All Rights Reserved.