# Dimension (LWJGL API)
Date: 2015-07-28

## org.lwjgl.util
Class Dimension

    java.lang.Object
      org.lwjgl.util.Dimension

All Implemented Interfaces:
  java.io.Serializable, ReadableDimension, WritableDimension

    public final class Dimension

extends java.lang.Object
implements java.io.Serializable, ReadableDimension, WritableDimension

A 2D integer Dimension class, which looks remarkably like an AWT one.

Version:
  $Revision$ $Id$
Author:
  $Author$
See Also:
  Serialized Form

Constructor Summary
`Dimension()` Constructor for Dimension.
`Dimension(int w, int h)` Constructor for Dimension.
`Dimension(ReadableDimension d)` Constructor for Dimension.

Method Summary
`boolean` `equals(java.lang.Object obj)` Checks whether two dimension objects have equal values.
`int` `getHeight()` Gets the height.
`void` `getSize(WritableDimension dest)` Copy this ReadableDimension into a destination Dimension
`int` `getWidth()` Gets the width.
`int` `hashCode()` Returns the hash code for this `Dimension`.
`void` `setHeight(int height)` Sets the height.
`void` `setSize(int w, int h)`
`void` `setSize(ReadableDimension d)`
`void` `setWidth(int width)` Sets the width.
`java.lang.String` `toString()` Returns a string representation of the values of this `Dimension` object's `height` and `width` fields.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Dimension

    public Dimension()

  Constructor for Dimension.

### Dimension

    public Dimension(int w,
                     int h)

  Constructor for Dimension.

### Dimension

    public Dimension(ReadableDimension d)

  Constructor for Dimension.

Method Detail

### setSize

    public void setSize(int w,
                        int h)

  Specified by:
    `setSize` in interface `WritableDimension`

### setSize

    public void setSize(ReadableDimension d)

  Specified by:
    `setSize` in interface `WritableDimension`

### getSize

    public void getSize(WritableDimension dest)

  Description copied from interface: `ReadableDimension`
  Copy this ReadableDimension into a destination Dimension

  Specified by:
    `getSize` in interface `ReadableDimension`
  Parameters:
    `dest` - The destination

### equals

    public boolean equals(java.lang.Object obj)

  Checks whether two dimension objects have equal values.

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  Returns the hash code for this `Dimension`.

  Overrides:
    `hashCode` in class `java.lang.Object`
  Returns:
    a hash code for this `Dimension`

### toString

    public java.lang.String toString()

  Returns a string representation of the values of this `Dimension` object's `height` and `width` fields. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be `null`.

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    a string representation of this `Dimension` object

### getHeight

    public int getHeight()

  Gets the height.

  Specified by:
    `getHeight` in interface `ReadableDimension`
  Returns:
    Returns a int

### setHeight

    public void setHeight(int height)

  Sets the height.

  Specified by:
    `setHeight` in interface `WritableDimension`
  Parameters:
    `height` - The height to set

### getWidth

    public int getWidth()

  Gets the width.

  Specified by:
    `getWidth` in interface `ReadableDimension`
  Returns:
    Returns a int

### setWidth

    public void setWidth(int width)

  Sets the width.

  Specified by:
    `setWidth` in interface `WritableDimension`
  Parameters:
    `width` - The width to set

Copyright © 2002-2009 lwjgl.org. All Rights Reserved.