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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Dimension()Constructor for Dimension.Dimension(int w, int h)Constructor for Dimension.Dimension(ReadableDimension d)Constructor for Dimension.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Checks whether two dimension objects have equal values.intgetHeight()Gets the height.voidgetSize(WritableDimension dest)Copy this ReadableDimension into a destination DimensionintgetWidth()Gets the width.inthashCode()Returns the hash code for thisDimension.voidsetHeight(int height)Sets the height.voidsetSize(int w, int h)voidsetSize(ReadableDimension d)voidsetWidth(int width)Sets the width.StringtoString()Returns a string representation of the values of thisDimensionobject'sheightandwidthfields.
-
-
-
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:
setSizein interfaceWritableDimension
-
setSize
public void setSize(ReadableDimension d)
- Specified by:
setSizein interfaceWritableDimension
-
getSize
public void getSize(WritableDimension dest)
Description copied from interface:ReadableDimensionCopy this ReadableDimension into a destination Dimension- Specified by:
getSizein interfaceReadableDimension- Parameters:
dest- The destination
-
equals
public boolean equals(Object obj)
Checks whether two dimension objects have equal values.
-
hashCode
public int hashCode()
Returns the hash code for thisDimension.
-
toString
public String toString()
Returns a string representation of the values of thisDimensionobject'sheightandwidthfields. 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:
getHeightin interfaceReadableDimension- Returns:
- Returns a int
-
setHeight
public void setHeight(int height)
Sets the height.- Specified by:
setHeightin interfaceWritableDimension- Parameters:
height- The height to set
-
getWidth
public int getWidth()
Gets the width.- Specified by:
getWidthin interfaceReadableDimension- Returns:
- Returns a int
-
setWidth
public void setWidth(int width)
Sets the width.- Specified by:
setWidthin interfaceWritableDimension- Parameters:
width- The width to set
-
-