Package com.helger.commons.dimension
Class SizeLong
java.lang.Object
com.helger.commons.dimension.SizeLong
- All Implemented Interfaces:
IHasDimensionLong,IHasHeightLong,IHasWidthLong
This class represents an object having width and height.
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionSizeLong(long nWidth, long nHeight) SizeLong(IHasDimensionInt aObj) SizeLong(IHasDimensionLong aObj) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetAdded(IHasDimensionLong aToAdd) getBestMatchingSize(long nMaxWidth, long nMaxHeight) Return the scaled width and height relative to a maximum size.longgetScaledToHeight(long nNewHeight) getScaledToWidth(long nNewWidth) getSubtracted(IHasDimensionLong aToSubtract) longgetWidth()inthashCode()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.commons.dimension.IHasDimensionLong
isLandscape, isPortrait, isQuadratic
-
Constructor Details
-
SizeLong
-
SizeLong
-
SizeLong
-
-
Method Details
-
getWidth
- Specified by:
getWidthin interfaceIHasWidthLong- Returns:
- The width of an object
-
getHeight
- Specified by:
getHeightin interfaceIHasHeightLong- Returns:
- The height of an object
-
getBestMatchingSize
@Nonnull @CheckReturnValue public SizeLong getBestMatchingSize(@Nonnegative long nMaxWidth, @Nonnegative long nMaxHeight) Return the scaled width and height relative to a maximum size.- Parameters:
nMaxWidth- Maximum width. Must be > 0.nMaxHeight- Maximum height. Must be > 0.- Returns:
- An array with 2 elements, where the first element is the width, and the second is the height.
-
getScaledToWidth
-
getScaledToHeight
-
getAdded
-
getSubtracted
-
equals
-
hashCode
public int hashCode() -
toString
-