Package com.nomagic.ui
Class UnmodifiableDimension
java.lang.Object
com.nomagic.ui.UnmodifiableDimension
Unmodifiable dimension. Values can not be modified after creation.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final UnmodifiableDimension
Empty dimension holder.final int
Dimension's heightfinal int
Dimension's width -
Method Summary
Modifier and TypeMethodDescriptionstatic UnmodifiableDimension
create
(int width, int height) Factory method to create an instance of UnmodifiableDimension.static UnmodifiableDimension
Creates dimension from given @Dimension
boolean
int
Returns heightint
getWidth()
Returns widthint
hashCode()
set
(int width, int height) Applies given width and height to selfApplies given dimension to selfsetHeight
(int height) Applies given height to selfsetWidth
(int width) Applies given width to selfConverts to @Dimension
toString()
Returns a string representation of thisUnmodifiableDimension
object.
-
Field Details
-
EMPTY
Empty dimension holder. -
width
public final int widthDimension's width -
height
public final int heightDimension's height
-
-
Method Details
-
create
Factory method to create an instance of UnmodifiableDimension.- Parameters:
width
- widthheight
- height- Returns:
- instance
-
create
Creates dimension from given @Dimension
- Parameters:
dimension
- dimension- Returns:
- created dimension
-
set
Applies given width and height to self- Parameters:
width
- widthheight
- height- Returns:
- new dimension or self if width and height are not changed
-
set
Applies given dimension to self- Parameters:
dimension
- dimension- Returns:
- new dimension or self if width and height are not changed
-
setWidth
Applies given width to self- Parameters:
width
- width- Returns:
- new dimension or self if width is not changed
-
setHeight
Applies given height to self- Parameters:
height
- height- Returns:
- new dimension or self if height is not changed
-
getWidth
public int getWidth()Returns width- Returns:
- width
-
getHeight
public int getHeight()Returns height- Returns:
- height
-
equals
-
hashCode
public int hashCode() -
toString
Returns a string representation of thisUnmodifiableDimension
object. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. -
toDimension
Converts to @Dimension
- Returns:
-