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