Package org.lwjgl.util
Class Dimension
java.lang.Object
org.lwjgl.util.Dimension
- All Implemented Interfaces:
Serializable
,ReadableDimension
,WritableDimension
public final class Dimension
extends Object
implements Serializable, ReadableDimension, WritableDimension
A 2D integer Dimension class, which looks remarkably like an AWT one.
- Version:
- $Revision$ $Id$
- Author:
- $Author$
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for Dimension.Dimension
(int w, int h) Constructor for Dimension.Constructor for Dimension. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks whether two dimension objects have equal values.int
Gets the height.void
getSize
(WritableDimension dest) Copy this ReadableDimension into a destination Dimensionint
getWidth()
Gets the width.int
hashCode()
Returns the hash code for thisDimension
.void
setHeight
(int height) Sets the height.void
setSize
(int w, int h) void
void
setWidth
(int width) Sets the width.toString()
Returns a string representation of the values of thisDimension
object'sheight
andwidth
fields.
-
Constructor Details
-
Dimension
public Dimension()Constructor for Dimension. -
Dimension
public Dimension(int w, int h) Constructor for Dimension. -
Dimension
Constructor for Dimension.
-
-
Method Details
-
setSize
public void setSize(int w, int h) - Specified by:
setSize
in interfaceWritableDimension
-
setSize
- Specified by:
setSize
in interfaceWritableDimension
-
getSize
Description copied from interface:ReadableDimension
Copy this ReadableDimension into a destination Dimension- Specified by:
getSize
in interfaceReadableDimension
- Parameters:
dest
- The destination
-
equals
Checks whether two dimension objects have equal values. -
hashCode
public int hashCode()Returns the hash code for thisDimension
. -
toString
Returns a string representation of the values of thisDimension
object'sheight
andwidth
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 benull
. -
getHeight
public int getHeight()Gets the height.- Specified by:
getHeight
in interfaceReadableDimension
- Returns:
- Returns a int
-
setHeight
public void setHeight(int height) Sets the height.- Specified by:
setHeight
in interfaceWritableDimension
- Parameters:
height
- The height to set
-
getWidth
public int getWidth()Gets the width.- Specified by:
getWidth
in interfaceReadableDimension
- Returns:
- Returns a int
-
setWidth
public void setWidth(int width) Sets the width.- Specified by:
setWidth
in interfaceWritableDimension
- Parameters:
width
- The width to set
-