Package com.helger.pdflayout.spec
Class SizeSpec
- java.lang.Object
-
- com.helger.pdflayout.spec.SizeSpec
-
- All Implemented Interfaces:
Serializable
@Immutable @MustImplementEqualsAndHashcode public class SizeSpec extends Object implements Serializable
This class defines a size.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static floatDEFAULT_FLOATstatic SizeSpecSIZE_MAXstatic SizeSpecSIZE0
-
Constructor Summary
Constructors Constructor Description SizeSpec(float fWidth, float fHeight)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SizeSpeccreate(org.apache.pdfbox.pdmodel.common.PDRectangle aRect)static SizeSpeccreateMM(float fWidth, float fHeight)booleanequals(Object o)org.apache.pdfbox.pdmodel.common.PDRectanglegetAsRectangle()floatgetHeight()floatgetWidth()inthashCode()static SizeSpecheight(float fHeight)SizeSpecminus(float fWidth, float fHeight)SizeSpecminus(SizeSpec aOther)SizeSpecplus(float fWidth, float fHeight)SizeSpecplus(SizeSpec aOther)StringtoString()static SizeSpecwidth(float fWidth)SizeSpecwithHeight(float fHeight)SizeSpecwithWidth(float fWidth)
-
-
-
Field Detail
-
DEFAULT_FLOAT
public static final float DEFAULT_FLOAT
- See Also:
- Constant Field Values
-
SIZE0
public static final SizeSpec SIZE0
-
SIZE_MAX
public static final SizeSpec SIZE_MAX
-
-
Constructor Detail
-
SizeSpec
public SizeSpec(@Nonnegative float fWidth, @Nonnegative float fHeight)
Constructor- Parameters:
fWidth- Width. Must be ≥ 0.fHeight- Height. Must be ≥ 0.
-
-
Method Detail
-
getWidth
@Nonnegative public final float getWidth()
- Returns:
- Width. Always ≥ 0.
-
getHeight
@Nonnegative public final float getHeight()
- Returns:
- Height. Always ≥ 0.
-
getAsRectangle
@Nonnull public org.apache.pdfbox.pdmodel.common.PDRectangle getAsRectangle()
-
plus
@Nonnull @CheckReturnValue public SizeSpec plus(float fWidth, float fHeight)
-
plus
@Nonnull @CheckReturnValue public SizeSpec plus(@Nonnull SizeSpec aOther)
-
minus
@Nonnull @CheckReturnValue public SizeSpec minus(float fWidth, float fHeight)
-
minus
@Nonnull @CheckReturnValue public SizeSpec minus(@Nonnull SizeSpec aOther)
-
withWidth
@Nonnull @CheckReturnValue public SizeSpec withWidth(float fWidth)
-
withHeight
@Nonnull @CheckReturnValue public SizeSpec withHeight(float fHeight)
-
create
@Nonnull public static SizeSpec create(@Nonnull org.apache.pdfbox.pdmodel.common.PDRectangle aRect)
-
-