Class RelativeSize
- java.lang.Object
-
- net.coobird.thumbnailator.geometry.RelativeSize
-
-
Field Summary
Fields Modifier and Type Field Description private doublescalingFactorThe scaling factor to use for the enclosed object.
-
Constructor Summary
Constructors Constructor Description RelativeSize(double scalingFactor)Instantiates an object which calculates the size of an object, using the given scaling factor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Dimensioncalculate(int width, int height)Calculates the size of the object.java.lang.StringtoString()Returns aStringrepresentation of this object.
-
-
-
Constructor Detail
-
RelativeSize
public RelativeSize(double scalingFactor)
Instantiates an object which calculates the size of an object, using the given scaling factor.- Parameters:
scalingFactor- The scaling factor to use to determine the size of the enclosing object.- Throws:
java.lang.IllegalArgumentException- When the scaling factor is not within the range of0.0dand1.0d, inclusive.
-
-
Method Detail
-
calculate
public java.awt.Dimension calculate(int width, int height)Description copied from interface:SizeCalculates the size of the object.
-
toString
public java.lang.String toString()
Returns aStringrepresentation of this object.- Overrides:
toStringin classjava.lang.Object- Returns:
Stringrepresentation of this object.
-
-