@Immutable public class SizeInt extends Object implements IHasDimensionInt, Serializable
| Constructor and Description |
|---|
SizeInt(IHasDimensionInt aObj) |
SizeInt(int nWidth,
int nHeight) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
SizeInt |
getAdded(IHasDimensionInt aToAdd) |
SizeInt |
getBestMatchingSize(int nMaxWidth,
int nMaxHeight)
Return the scaled width and height relative to a maximum size.
|
int |
getHeight() |
SizeInt |
getScaledToHeight(int nNewHeight) |
SizeInt |
getScaledToWidth(int nNewWidth) |
SizeInt |
getSubtracted(IHasDimensionInt aToSubtract) |
int |
getWidth() |
int |
hashCode() |
String |
toString() |
public SizeInt(@Nonnull IHasDimensionInt aObj)
public SizeInt(@Nonnegative int nWidth, @Nonnegative int nHeight)
@Nonnegative public int getWidth()
getWidth in interface IHasWidthInt@Nonnegative public int getHeight()
getHeight in interface IHasHeightInt@Nonnull @CheckReturnValue public SizeInt getBestMatchingSize(@Nonnegative int nMaxWidth, @Nonnegative int nMaxHeight)
nMaxWidth - Maximum width. Must be > 0.nMaxHeight - Maximum height. Must be > 0.@Nonnull @CheckReturnValue public SizeInt getScaledToWidth(@Nonnegative int nNewWidth)
@Nonnull @CheckReturnValue public SizeInt getScaledToHeight(@Nonnegative int nNewHeight)
@Nonnull @CheckReturnValue public SizeInt getAdded(@Nonnull IHasDimensionInt aToAdd)
@Nonnull @CheckReturnValue public SizeInt getSubtracted(@Nonnull IHasDimensionInt aToSubtract)
Copyright © 2014–2017 Philip Helger. All rights reserved.