Package com.helger.commons.dimension
Class SizeDouble
java.lang.Object
com.helger.commons.dimension.SizeDouble
- All Implemented Interfaces:
IHasDimensionDouble,IHasHeightDouble,IHasWidthDouble
This class represents an object having width and height.
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionSizeDouble(double dWidth, double dHeight) SizeDouble(IHasDimensionFloat aObj) SizeDouble(IHasDimensionInt aObj) SizeDouble(IHasDimensionLong aObj) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetAdded(IHasDimensionDouble aToAdd) getAdded(IHasDimensionFloat aToAdd) getAdded(IHasDimensionInt aToAdd) getBestMatchingSize(double dMaxWidth, double dMaxHeight) Return the scaled width and height relative to a maximum size.doublegetScaledToHeight(double dNewHeight) getScaledToWidth(double dNewWidth) getSubtracted(IHasDimensionDouble aToSubtract) getSubtracted(IHasDimensionFloat aToSubtract) getSubtracted(IHasDimensionInt aToSubtract) doublegetWidth()inthashCode()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.commons.dimension.IHasDimensionDouble
isLandscape, isPortrait, isQuadratic
-
Constructor Details
-
SizeDouble
-
SizeDouble
-
SizeDouble
-
SizeDouble
-
SizeDouble
-
-
Method Details
-
getWidth
- Specified by:
getWidthin interfaceIHasWidthDouble- Returns:
- The width of an object
-
getHeight
- Specified by:
getHeightin interfaceIHasHeightDouble- Returns:
- The height of an object
-
getBestMatchingSize
@Nonnull @CheckReturnValue public SizeDouble getBestMatchingSize(@Nonnegative double dMaxWidth, @Nonnegative double dMaxHeight) Return the scaled width and height relative to a maximum size.- Parameters:
dMaxWidth- Maximum width. Must be > 0.dMaxHeight- 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
-
getAdded
-
getAdded
-
getSubtracted
-
getSubtracted
-
getSubtracted
@Nonnull @CheckReturnValue public SizeDouble getSubtracted(@Nonnull IHasDimensionDouble aToSubtract) -
equals
-
hashCode
public int hashCode() -
toString
-