wyvern.lib
Class Dimension

java.lang.Object
  extended bywyvern.lib.Dimension
All Implemented Interfaces:
java.io.Serializable

public class Dimension
extends java.lang.Object
implements java.io.Serializable

Encapsulates a width and height. Replacement for java.awt.Dimension.

Version:
1.0, Mar 5, 2002
Author:
Steve Yegge
See Also:
Serialized Form

Field Summary
 int height
           
 int width
           
 
Constructor Summary
Dimension()
          Constructs a new Dimension
Dimension(Dimension s)
          Constructs a new Dimension whose width and height are the same as for the specified Dimension.
Dimension(java.awt.Dimension d)
          Constructs a new Dimension from an AWT dimension.
Dimension(int width, int height)
          Constructs a new Dimension of the specified width and height.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if this Dimension is equal to another one.
 int getHeight()
          Returns height.
 int getWidth()
          Returns width.
 int hashCode()
          Returns the hash code for this Dimension
 java.lang.String toString()
          Returns formatted string for this Dimension.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

width

public int width

height

public int height
Constructor Detail

Dimension

public Dimension()
Constructs a new Dimension


Dimension

public Dimension(Dimension s)
Constructs a new Dimension whose width and height are the same as for the specified Dimension.


Dimension

public Dimension(int width,
                 int height)
Constructs a new Dimension of the specified width and height.


Dimension

public Dimension(java.awt.Dimension d)
Constructs a new Dimension from an AWT dimension.

Method Detail

getWidth

public int getWidth()
Returns width. You can also access it directly.


getHeight

public int getHeight()
Returns height. You can also access it directly.


hashCode

public int hashCode()
Returns the hash code for this Dimension

Returns:
a hash code for this Dimension

toString

public java.lang.String toString()
Returns formatted string for this Dimension.


equals

public boolean equals(java.lang.Object obj)
Returns true if this Dimension is equal to another one.