public class Resolution
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
height
The height in pixel.
|
private int |
width
The width in pixel.
|
Constructor and Description |
---|
Resolution(int width,
int height)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Dimension |
asDimension()
Returns the resolution as a
Dimension instance. |
boolean |
equals(java.lang.Object obj) |
boolean |
equalsDisplayMode(java.awt.DisplayMode displayMode)
Returns whether this resolution matches a
DisplayMode 's
resolution. |
int |
getHeight()
Returns the height in pixels.
|
int |
getWidth()
Returns the width in pixels.
|
int |
hashCode() |
static Resolution |
parse(java.lang.String str)
Creates a new instance from string representation.
|
java.lang.String |
toString() |
private final int height
private final int width
public Resolution(int width, int height)
width
- the width in pixelsheight
- the height in pixels@NotNull public java.awt.Dimension asDimension()
Dimension
instance.public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object
public boolean equalsDisplayMode(@NotNull java.awt.DisplayMode displayMode)
DisplayMode
's
resolution.displayMode
- the display modepublic int getHeight()
public int getWidth()
public int hashCode()
hashCode
in class java.lang.Object
@Nullable public static Resolution parse(@NotNull java.lang.String str)
toString()
.str
- the string representationResolution instance
, or null
if the string
representation is invalid@NotNull public java.lang.String toString()
toString
in class java.lang.Object