us.zuercher.gpx2map.util
Class Dimension

java.lang.Object
  extended by us.zuercher.gpx2map.util.Dimension

public class Dimension
extends Object

Dimension represents the dimensions of an image.

Author:
Stephan Zuercher

Field Summary
private  int height
          Image height.
private  int width
          Image width.
 
Constructor Summary
Dimension(int width, int height)
          Constructs a new Dimension object with the given width and height.
 
Method Summary
 boolean equals(Dimension other)
          Tests whether this Dimension is equal to another.
 boolean equals(Object other)
          Tests whether this Dimension is equal to another.
 int getHeight()
          Returns the image's height.
 int getWidth()
          Returns the image's width.
 int hashCode()
          Computes a reasonable hash code for this Dimension.
 String toString()
          Returns a string representing a Dimension of the format "[w]x[h]".
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

width

private final int width
Image width.


height

private final int height
Image height.

Constructor Detail

Dimension

public Dimension(int width,
                 int height)
Constructs a new Dimension object with the given width and height.

Parameters:
width - image width
height - image height
Method Detail

getWidth

public int getWidth()
Returns the image's width.

Returns:
the image's width.

getHeight

public int getHeight()
Returns the image's height.

Returns:
the image's height.

toString

public String toString()
Returns a string representing a Dimension of the format "[w]x[h]".

Overrides:
toString in class Object
Returns:
a string representing a Dimension.

hashCode

public int hashCode()
Computes a reasonable hash code for this Dimension.

Overrides:
hashCode in class Object
Returns:
a reasonable hash code for this Dimension.

equals

public boolean equals(Dimension other)
Tests whether this Dimension is equal to another.

Parameters:
other - another Dimension
Returns:
if the Dimensions have the same width and height.

equals

public boolean equals(Object other)
Tests whether this Dimension is equal to another.

Overrides:
equals in class Object
Parameters:
other - another Dimension
Returns:
if the Dimensions have the same width and height.
Throws:
ClassCastException - if other is not a Dimension