Package com.nomagic.ui
Class UnmodifiableDimension
java.lang.Object
com.nomagic.ui.UnmodifiableDimension
Unmodifiable dimension. Values can not be modified after creation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UnmodifiableDimensionEmpty dimension holder.final intDimension's heightfinal intDimension's width -
Method Summary
Modifier and TypeMethodDescriptionstatic UnmodifiableDimensioncreate(int width, int height) Factory method to create an instance of UnmodifiableDimension.static UnmodifiableDimensionCreates dimension from given @DimensionbooleanintReturns heightintgetWidth()Returns widthinthashCode()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 @DimensiontoString()Returns a string representation of thisUnmodifiableDimensionobject.
-
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 thisUnmodifiableDimensionobject. 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:
-